mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 22:53:18 +00:00
chore(sogo-ealarms-notify): properly close all DB channels
This prevent MySQL from logging an error (Aborted connection to db).
This commit is contained in:
@@ -399,6 +399,27 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60;
|
||||
}
|
||||
}
|
||||
|
||||
- (void) releaseAllChannels
|
||||
{
|
||||
EOAdaptorChannel *channel;
|
||||
GCSChannelHandle *handle;
|
||||
NSEnumerator *e;
|
||||
|
||||
e = [busyChannels objectEnumerator];
|
||||
while ((handle = [e nextObject]))
|
||||
{
|
||||
[handle retain];
|
||||
ASSIGN (handle->lastReleaseTime, [NSCalendarDate date]);
|
||||
[busyChannels removeObject: handle];
|
||||
channel = [handle channel];
|
||||
if (debugPools)
|
||||
[self logWithFormat: @"releaseAllChannels: freeing old channel (age %ds, %p) ", (int)[handle age], channel];
|
||||
if ([channel isOpen])
|
||||
[channel closeChannel];
|
||||
[handle release];
|
||||
}
|
||||
}
|
||||
|
||||
/* checking for tables */
|
||||
|
||||
- (BOOL) canConnect: (NSURL *) _url
|
||||
|
||||
Reference in New Issue
Block a user