When I run scripts on Replit in ‘always on’ mode, they loop through the same records from a CSV file multiple times (which doesn’t happen when running the same script on my machine).
Example Repl: https://replit.com/@kacper7777777/Status-checker#main.rb
How can I prevent it?
As far as I know, this does absolutely nothing to non-web Repls.
You’re right. Just saw this in the docs:
Always On does not extend your Repl’s lifetime, and all Repls are subject to go to sleep at any time. However, Always On will immediately run your Repl again whenever this happens.
So basically this causes the loop to restart.
How to fix this though?
Maybe programmatically, by adding a lock file whose name is the date if the last time it run