plugin-update-checker icon indicating copy to clipboard operation
plugin-update-checker copied to clipboard

Randomize firstCheckTime into the future, rather than scheduling in the past

Open esoderquist opened this issue 3 years ago • 2 comments

Presently a random offset is subtracted from time() and scheduled (such that the event is scheduled in the past, causing the job to execute on each WP-Cron execution since the scheduled time has passed). PR changes this to schedule the next update cycle at a randomized time in the future.

esoderquist avatar Feb 07 '22 23:02 esoderquist

If I remember correctly, the intent of using a past timestamp was to ensure that the first update check would happen as soon as possible, and all future checks would happen with a randomized offset. See #323 for some relevant discussion.

By using a positive offset, we would lose that first, immediate check.

YahnisElsts avatar Feb 08 '22 13:02 YahnisElsts