17 Replies
Project ID:
N/A
N/A
railway's cron jobs are limited to every 15 minutes
15 minutes is ok
But where can I configure cron job command?
you would want to make a new service, set the cron job, and then set the start command in the service settings
Then how can I connect to the main service? should I upload files there too?
doesn't this only do stuff with the database?
yes but when you run php artisan schedule:run command it needs "artisan" file to run scheduled commands
of course, so you deploy your code into another service, just set a different start command
Ok thank you
I created new service for crons but it ran only once
ah right, you need to configure your app to exit after the cron job runs
railway will not re-run the cron job if your app is still running
How can i do that?
i just looked it up
php artisan schedule:work
starts its own scheduler, this command should not be run on a cron schedule, just use it as your start command and remove the cron stuff from the service
The schedule:work
command will run in the foreground and invoke the scheduler every minute until you terminate the command
Ok thank you!
no problem!