R
Railway2y 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
Percy2y ago
Project ID: N/A
Brody
Brody2y ago
could you explain why you want this to happen? you're on the hobby plan, you can run it 24/7
sean
seanOP2y 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
Brody2y ago
sounds like you should just run a cron job
sean
seanOP2y 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
Brody2y 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
seanOP2y 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
Brody2y ago
they don't, and even if they did you would have to use their graphql api
Want results from more Discord servers?
Add your server