a year ago
project id: 11a4c6a4-f4a0-404a-8a1d-4ff7415b0b15
my railway.toml file:
[build]
builder = "nixpacks"
buildCommand = "npm run build"
[deploy]
startCommand = "npm start"
healthcheckPath = "/"
healthcheckTimeout = 100
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 10
[http]
force_ssl = true
[http.headers]
Access-Control-Allow-Origin = "*"
[[services]]
name = "bot"
protocol = "http"
internal_port = "3000"
envs = { NODE_ENV = "production" }
[[services.ports]]
port = 80
handlers = ["http"]
[[services.crons]]
schedule = "*/20 * * * *"
command = "curl ${RAILWAY_PRIVATE_DOMAIN}/cron"the cron setup hasnt kickstarted yet after deployment
3 Replies
changed the url to https://${RAILWAY_PUBLIC_DOMAIN}/cron and still doesnt work
So … that isn’t really what the railway cron is supposed to be used for. It just turns services on if they were off. See the psql backup template by Brody for a good example.
If you want to do this, you likely need your service to have cron built in and make it manage itself. Or you make a new service that’s sole job on turn on, is to call your endpoint.
a year ago
that's also not at all a valid railway.toml, it stops being valid after the deploy section.
in the future, for your reference, do not have AI write config files for you.
and what Josh said is correct, railway cron isn't going to curl for you.
can you explain why that's something you need? once we understand your usecase we can better help you with alternatives