closeio/sync-engine

Add Jitter To Google Sync Timeouts

AlecRosenbaum opened this issue · 0 comments

https://github.com/closeio/nylas/blob/55a5e719a203adf2f20008cc772255a3f2a95e9f/inbox/events/remote_sync.py#L34

Most accounts don't get new calendar events every hour. If most calendars timeout and force a sync at the same time, this results in spikes of API usage/processing every period.

This can be smoothed out by injecting some jitter/randomness into the timeout window. Over time, the randomness will cause the timeout window to drift and we'll end up with a more uniform syncing load.