@brandon Would a cron job or systemd timer work or does the application have to be constantly running?
@jbauer There's two issues with that:
the first is that that's just moving where the timer is set
the second is that it means setting up some of the bootstrapping over and over again rather than just keeping node running and just re-running the same command
@brandon Hm... I don't think I know of a more elegant way to do that then. You could check the system time, watch how much time has elapsed, then call app() when 5s has passed but that's an even less elegant solution. You could also wrap the whole thing in a while loop with a sleep(5) at the end but that's also less elegant than what you currently have.
I don't think there's any other way to solve the problem of "do thing every x units of time".
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.