sachsen-impfnotifier
sachsen-impfnotifier copied to clipboard
Update index.js
Random delay between 100 - 500 seconds would eliminate the risk of getting detected.
Hi Erdem, thanks for your PR 😊
While I like the idea behind your change, this currently only affects the default DELAY value.
What do you think about having a solution, which also works when setting a custom DELAY in the environment variables?
I could think of adding a new setting like "DELAY_SPREAD" which represents a maximum percentage, which is added or subtracted from the DELAY value.
By default it could be 0%, so the DELAY value is always used. When setting it to 20 and a DELAY of 1000, then the actually used value would be a random value between 800 and 1200. I hope you get the idea?
Finally, this random value should be updated on each iteration instead of once on startup, shouldn't it? Currently the requests are still done in the same interval the whole time the application runs.
Let me know what you think about these suggestions and whether you think you could possibly find the time to implement it in such kind of a way as part of this PR, or if you need some support 😊