R
Railway•8mo ago
eirk

Config as Code fields null

How do i set a field like restartPolicyMaxRetries to null?
32 Replies
Percy
Percy•8mo ago
Project ID: N/A
eirk
eirk•8mo ago
No description
eirk
eirk•8mo ago
using "null" as the value errors, as well as just plain null
eirk
eirk•8mo ago
No description
eirk
eirk•8mo ago
No description
eirk
eirk•8mo ago
Im curious what the original intention was supposed to be also whats the default value?
Brody
Brody•8mo ago
10, disabling retrying is a different field
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"deploy": {
"restartPolicyType": "NEVER"
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"deploy": {
"restartPolicyType": "NEVER"
}
}
once restartPolicyType is set to NEVER you just omit the restartPolicyMaxRetries field
eirk
eirk•8mo ago
wheres that documented, or is it not? how would u make it lways restart on crash?
Brody
Brody•8mo ago
every service you have ever created would have shown the default as 10 🤣 set restartPolicyType to ALWAYS pro tip, use a railway.json file with the schema shown above and edit it on an ide that supports validating the document against that schema (vscode)
eirk
eirk•8mo ago
but toml looks nicer 😢
Brody
Brody•8mo ago
i mean 99% of your questions could have been answered with the autocomplete vscode gives you on a json document with a schema
eirk
eirk•8mo ago
what 99% of my questions default value wasnt answered null wasnt answered
Brody
Brody•8mo ago
10 null is a json thing lol the json schema for railway.json allows for null
eirk
eirk•8mo ago
how come the examples deal with toml then also ^
Brody
Brody•8mo ago
already answered the author liked toml, just like you 🤣
eirk
eirk•8mo ago
i tought: ON_FAILURE - restart when the service exits with a non-zero exit code, up to restartPolicyMaxRetries times ALWAYS - restart when the service exits with any exit code, up to restartPolicyMaxRetries times NEVER - dont restart but r u saying that ALWAYS - restart when the service exits with a non-zero exit code, always ?
Brody
Brody•8mo ago
given the fact that the input box disappears when you select always, leads me to believe that its the last option you gave but now that im thinking about it, infinitely restating a service on crash would be kinda pointless
eirk
eirk•8mo ago
i just want concise and precise docs 😭
Brody
Brody•8mo ago
can i ask you a question and not have it sounds rude?
eirk
eirk•8mo ago
yes?
Brody
Brody•8mo ago
genuine question, genuinely curious. you have been in this server for a long time, and have also been using railway for a very long time, so why are you always asking questions like you just started using the platform last week over text this sounds rude, but i promise you i dont mean any ill intent
eirk
eirk•8mo ago
i rarely look at railway docs bc railway is so good that i dont need to make changes to my config, but when i do, i want to be very sure it does what i want it to do here, these config as code changes are something im not familiar bc i last touched them like a year ago
Brody
Brody•8mo ago
i see, thank you
eirk
eirk•8mo ago
i also have high expectations of railway in terms of service, docs, and reliability
Brody
Brody•8mo ago
oh are you on pro?
eirk
eirk•8mo ago
no
Brody
Brody•8mo ago
oh
eirk
eirk•8mo ago
i just mean that i dont expect railway to have major issues or problems with functionality
Brody
Brody•8mo ago
most of their problems are with the builder it seems, i have never had a running service go down where railway was at fault
eirk
eirk•8mo ago
same here, and i continue to expect that from railway
Brody
Brody•8mo ago
well tbh they dont have an SLA so you cant really expect it
eirk
eirk•8mo ago
true