Is there a way to auto restart a service to save memory? There an api available that we can trigger?
I want to see if there is a way to restart my service in specified durations. if there's an api trigger, that would help too.
23 Replies
Project ID:
N/A
N/A
I'll do you one better than an api
https://railway.app/template/fwH-l3
bookmarklet website has changed to
https://bookmarklets.up.railway.app/cron-config/
life saver. thanks so much
time=2023-09-05T09:57:57.215Z level=ERROR msg="failed retrieving user information: input:3: me Not Authorized"
Any chance you know how i can fix this?
ime=2023-09-05T09:57:57.141Z level=INFO msg="parsed schedules from environment successfully" found_schedules=1
time=2023-09-05T09:57:57.141Z level=INFO msg="found schedule" service_id=8b5f7be3-4a54-44b3-ac51-175b4f1ba975/variables action=restart expression="55 * * * *"
time=2023-09-05T09:57:57.215Z level=ERROR msg="failed retrieving user information: input:3: me N
I believe i copied the token correctly.
hey, can you link me to your project?
ca440142-97f8-497c-8374-bdd45e8e3749
project id
the token you added, is it a project token?
project -> settings -> tokens
no, account -> settings -> tokens
try it with a project token
actually no don't, I doubt that'd work
is the token you created tied to your team?
yes
i tried with 3 different tokens, same issue
@Brody
time=2023-09-05T09:57:57.215Z level=ERROR msg="failed retrieving user information: input:3: me N^ is it calling the
me
query? I think you'd have to call another endpoint for retrieving team infogive me a team account so I can test, id be happy to make this work, but I don't know how to do that without a team account π
sent ya an invite π
woohoo pro plan
I'll work on this soon!
thanks both.
alright so ive fixed two things, a bug in the bookmarklet, and now the template can restart services that reside within a team.
- remove your current "Railway Cron Config" bookmarklet and add it back https://bookmarklets.up.railway.app/cron-config/
- generate the same schedule string
- update the schedule service variable
- let the service redeploy, it should pull the updated docker image and just start working
and a little tag for extra visibility @Yash π
and thanks ray, without you i wouldnt have been able to fix this
Cool!
just make sure you use the appropriate token, for the service you want to restart
you mean the account token, right?
Worked it seems, thanks!
awesome, fixed on the first try that's unlike me
@Brody Thank you so much, this is what i have been looking for!
no problem, let me know if there are any problems