phw198 / OutlookGoogleCalendarSync

Sync your Outlook and Google calendars
https://www.outlookgooglecalendarsync.com/
Mozilla Public License 2.0
1.8k stars 216 forks source link

Syncs take a long time and log is spammed with "Failed to find master Google event for" messages #1738

Closed watercrossing closed 8 months ago

watercrossing commented 10 months ago

Checklist:-

  • [X] Upgrade to the latest release (alpha if available) latest release
  • [X] Reproduce the issue
  • [X] Complete the information below
  • [X] Provide your OGcalsync.log file (see how-to)

OGCS Version: v2.10.2 Edition: Installed Sync Direction: G->O<-G

Bug Description
Recently I have noticed that my sync take a lot longer (6 minutes) than before (I don't seem to have log files from before, but I am sure it used to be <1min). The log file is now filled with the following three lines repeating about 1000 times:

DEBUG  8 OutlookGoogleCalendarSync.GoogleOgcs.Calendar [286] -  Retrieving all events from Google: 25/01/2023 -> 26/01/2023
DEBUG  8 OutlookGoogleCalendarSync.GoogleOgcs.Calendar [300] -  Page 1 received.
WARN  8 OutlookGoogleCalendarSync.Recurrence [562] -  Failed to find master Google event for: 25/01/2023 21:30 (R) => "PrivateEvent"

Any other information
I have two sync profiles set up, both syncing G->O, i.e. syncing two Google Calendars to the same outlook calendar. As far as I can see, the errors occur when syncing profile A it is unable to find events that where created in outlook by sync B and vice versa.

Log file redactedlog.txt

phw198 commented 9 months ago

Did you always have this configuration of 2 Google calendars merged into a single Outlook calendar? I don't think there's a slow-down due to a recent OGCS version, as I don't recall anything changing in this area, but....there is an efficiency gain to be made here.

If the sync is G->O, it's a merge sync and the Google calendar ID held against the Outlook item does not match the source Google calendar currently being synced, then don't bother to try and find the master Google event.

However, this is pretty edge-case and I'm not 100% sure about putting this in a release - could you let me know if the below hotfix dramatically improves your sync times?

:package: Hotfix v2.10.2.5.zip (see instructions for applying).

Instead of "Failed to find master Google event", it should now log

Outlook recurring master, outside sync window, originates from a different Google calendar than that being synced. Will not attempt to find matching Google master event.

Please let me know how it goes.

watercrossing commented 9 months ago

Hey,

Thank you for looking into this. Ever since it was possible to have multiple profiles I have been using OGCS that way: two merge syncs into one outlook calendar.

The sync with the new version took 2:55, so that is a significant improvement. There are still ~1500 DEBUG log messages (Outlook recurring master, outside sync window, originates from a different Google calendar than that being synced. Will not attempt to find matching Google master event.) They still consume 80 seconds of program time, but that's much better than before.

I would appreciate if you could merge this, and perhaps also remove the DEBUG log message?

phw198 commented 9 months ago

That does seem a significant improvement and yes, I was going to drop that log line to FINE after you'd tested it. Perhaps you could turn logging up to INFO temporarily to see how much time a sync takes without logging 1500 DEBUG lines too...

watercrossing commented 9 months ago

Changing the log level to INFO does not impact the sync time.