Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…alendarSync into release

Closes #1385
  • Loading branch information
phw198 committed Apr 10, 2022
2 parents 06d4798 + e44ba86 commit 2fb6537
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/OutlookGoogleCalendarSync/Sync/Timer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ public PushSyncTimer(Object owningProfile) {
ResetLastRun();
this.Tag = "PushTimer";
this.Interval = 2 * 60000;
if (Program.InDeveloperMode) this.Interval = 30000;
this.Tick += new EventHandler(ogcsPushTimer_Tick);
}

Expand All @@ -169,9 +170,14 @@ private void ogcsPushTimer_Tick(object sender, EventArgs e) {
log.UltraFine("Push sync triggered.");

try {
if (OutlookOgcs.Calendar.Instance.IOutlook.NoGUIexists()) return;

SettingsStore.Calendar profile = this.owningProfile as SettingsStore.Calendar;

//In case the IOutlook.Connect() has to be called which needs an active profile
if (Sync.Engine.Calendar.Instance.Profile == null)
//Force in the push sync profile
Sync.Engine.Calendar.Instance.Profile = profile;

if (OutlookOgcs.Calendar.Instance.IOutlook.NoGUIexists()) return;
log.Fine("Push sync triggered for profile: " + Settings.Profile.Name(profile));
System.Collections.Generic.List<Microsoft.Office.Interop.Outlook.AppointmentItem> items = OutlookOgcs.Calendar.Instance.GetCalendarEntriesInRange(profile, true);

Expand Down

0 comments on commit 2fb6537

Please sign in to comment.