automatically restarting my springboot application every 24 hours at 00:00 GMT
Hello, I have a web-based puzzle game that retrieves words from the database, every 24 hours. I made a function in springboot that will restart the run of the application, but when deployed with railway, it does not restart. Could I please get some assistance on how to ensure the springboot application restarts every 24 hours at 00:00 GMT. I am very new to SpringBoot and railway. Thank you in advance.
14 Replies
Project ID:
d781fa1d-7aa1-405f-91b9-977dcd01e020
You might find these helpful:
- Does Railway do dyno restarts like Heroku?
- Auto sleep after a while like Heroku
- Help deploying a spring boot application
⚠️ experimental feature
d781fa1d-7aa1-405f-91b9-977dcd01e020
this seems more like an XY Question if I'm being honest
Oh sorry, where do I ask this?
you're in the right place, it just seems like restarting your whole app is a botch job to reset something
What would you advise?
well first, what does restarting your application at that time achieve?
it pulls new words from our database
otherwise the same words are used.
okay then just pull the new words without restarting
But we need it to specifically pull at 00:00 GMT
Hmm wait
Is there SQL queries I can pull on that?
Also we would need our automated solver to work every time at 00:00 GMT as well
yeah I'm not familiar with Java but I'm sure there is some in code Cron scheduler that can just call the already existing bit of code that pulls words on app start
Hmm Okay!
I'm also sure there's a hand full of ways to do this, but an in code cron scheduler is the way I'd do it, don't know if best but maybe simplest