R
Railway13mo ago
sean

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
Solution:
sounds like you should just run a cron job
Jump to solution
8 Replies
Percy
Percy13mo ago
Project ID: N/A
Brody
Brody13mo ago
could you explain why you want this to happen? you're on the hobby plan, you can run it 24/7
sean
sean13mo ago
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
Brody
Brody13mo ago
sounds like you should just run a cron job
sean
sean13mo ago
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?
Brody
Brody13mo ago
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
sean
sean13mo ago
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
Brody
Brody13mo ago
they don't, and even if they did you would have to use their graphql api