mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +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:
@@ -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