maintner: make github poll more often after webhook wakeup fails to see new data

Sometimes Github sends a webhook update (which we only use as a
wake-up signal, ignoring the payload), but when we go to run our
sync-from-last-position code, we get cache hits from GitHub indicating
that nothing's new. It seems that GitHub sends webhooks before
invalidating its own caches.

This causes us to sometimes lose updates for 15 minutes until our
regular backup poller catches them.

So, keep track of whether we've been woken up by the webhook and are
currently awaiting new data. If the subsequent poll finds nothing,
assume it's bogus and reset our poll interval to be 1 second, growing
exponentially until either we're back at 15 minutes or we have new
data.

Change-Id: Iff38517a8a8773eb13323870a80e0855084a58ef
Reviewed-on: https://go-review.googlesource.com/41392
Reviewed-by: Kevin Burke <kev@inburke.com>
1 file changed