@Dielee while checking the other PR I came across mentioned function, and how it created trouble. When having long sleep times, like e.g. mentioned here the 'take half of the sleep and randomize with it' creates really really long sleep times.
Sadly I cannot remember the intention behind it. If I assume correctly, it was just to stress the API less and prevent calls from everyone at the same second (e.g. 17:00:00)?
I simplified it by just adding a random of 0-20 seconds and added some test cases, that prove the expected next fetch interval is in the range it should be.
Might have a look if my sleepy brain was on a correct path?
@Dielee while checking the other PR I came across mentioned function, and how it created trouble. When having long sleep times, like e.g. mentioned here the 'take half of the sleep and randomize with it' creates really really long sleep times.
Sadly I cannot remember the intention behind it. If I assume correctly, it was just to stress the API less and prevent calls from everyone at the same second (e.g. 17:00:00)?
I simplified it by just adding a random of 0-20 seconds and added some test cases, that prove the expected next fetch interval is in the range it should be.
Might have a look if my sleepy brain was on a correct path?