mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(fix) retry connection if abruptly closed
This commit is contained in:
@@ -203,6 +203,9 @@ static BOOL debugLeaks;
|
||||
[NSString stringWithFormat: @"SELECT count(*) FROM %@",
|
||||
tableName]])
|
||||
{
|
||||
// We re-acquire the channel in case it was abruptly closed between statements
|
||||
if (![tc isOpen])
|
||||
tc = [cm acquireOpenChannelForURL: channelURL];
|
||||
tableScript = [self _sqlScriptForTable: tableName
|
||||
withType: tableType
|
||||
andFileSuffix: fileSuffix];
|
||||
@@ -236,6 +239,9 @@ static BOOL debugLeaks;
|
||||
type = [GCSFolderType folderTypeWithName: typeName];
|
||||
if (type)
|
||||
{
|
||||
// We re-acquire the channel in case it was abruptly closed between statements
|
||||
if (![channel isOpen])
|
||||
channel = [cm acquireOpenChannelForURL: [NSURL URLWithString: url]];
|
||||
sql = [type sqlQuickCreateWithTableName: tableName];
|
||||
if (!(ex = [channel evaluateExpressionX: sql]))
|
||||
[self logWithFormat: @"sogo quick table '%@' successfully created!",
|
||||
|
||||
Reference in New Issue
Block a user