mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-08 13:27:15 +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:
1 parent
7d07ddaffd
commit
cf40a23b43
4 files changed
+39
-6
No files matched your search
@@ -53,6 +53,9 @@
|
||||
#import <Appointments/SOGoAptMailReminder.h>
|
||||
#import <WEExtensions/WEResourceManager.h>
|
||||
|
||||
#import <GDLContentStore/GCSChannelManager.h>
|
||||
#import <GDLContentStore/GCSFolderManager.h>
|
||||
|
||||
#import "SOGoEAlarmsNotifier.h"
|
||||
|
||||
@implementation SOGoEAlarmsNotifier
|
||||
@@ -225,6 +228,8 @@
|
||||
|
||||
- (BOOL) run
|
||||
{
|
||||
GCSChannelManager *cm;
|
||||
GCSFolderManager *fm;
|
||||
NSArray *arguments, *alarms;
|
||||
NSCalendarDate *startDate, *toDate;
|
||||
NSDictionary *d;
|
||||
@@ -270,7 +275,7 @@
|
||||
hour: 0 minute: -5
|
||||
second: 0]
|
||||
toDate: toDate
|
||||
withMetadata: metadata];
|
||||
withMetadata: metadata];
|
||||
|
||||
max = [alarms count];
|
||||
for (count = 0; count < max; count++)
|
||||
@@ -292,6 +297,10 @@
|
||||
nameInContainer: [[d objectForKey: @"record"] objectForKey: @"c_name"]];
|
||||
}
|
||||
|
||||
// GCSFolder has opened a channel; close it before ending the process
|
||||
fm = [GCSFolderManager defaultFolderManager];
|
||||
cm = [fm channelManager];
|
||||
[cm releaseAllChannels];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user