Keep my repo online only during a certain time span
Hello! Would it be possible to keep online my repo only during a certain time of the day? (e.g. from 2AM to 7PM)
I was thinking about writing a simple GitHub action that sends an API request to start and stop my container, but I can't seem to find any API reference.
Thank you in advance
8 Replies
Project ID:
N/A
could you explain why you want this to happen? you're on the hobby plan, you can run it 24/7
Because I'm fetching a service that goes offline every day at the same time for around one hour, and it would be useless to keep the machine online in the meantime
Solution
sounds like you should just run a cron job
I mean yeah the plan was to make a Cron job with GitHub to turn off the container and turn it back on
Are crons supported natively by Railway?
railway has no cron service, you would have to run the cron in code. doing it via a github action just sounds overly complicated to me
With GitHub it's a one liner really, I would just have to know if Railway's API supports turning on and off a certain repo
they don't, and even if they did you would have to use their graphql api