Ask coding questions

← Back to all posts
Do scripts auto timeout?
freshcoder (1)

I read somewhere in the docs that infinite loops are possible. Does that mean I can leave a script running for weeks? Such as a bot?

TheDrone7 (1900)

Infinite loops are not allowed on if I recall correctly. scripts stop after somewhat between 30 minutes to 1 hour of inactivity.

You can leave a script running for long amounts of time by setting up a HTTP web server and then pinging the repl every 30 minutes or something like that using uptimerobot or @Kognise 's pinging tool.

freshcoder (1)

@TheDrone7 how would I keep a script running for 48 - 72 hours?

TheDrone7 (1900)

@freshcoder running for that long continuously won't be possible. There will be slight downtime. The way I suggested would bring it back online after it goes down. Although it will try to prevent it from going down in the first place. The only way to keep a script running that long would be by hosting it yourself or using a vps.