2 years ago
Here's the translation:
---
I have a problem with a custom start command. I set the command php artisan schedule:run to execute my scheduled tasks, and everything runs fine. However, after that, it crashes the server. The command I execute is just a simple message for testing, and if I run it from Nixpack for testing, everything works fine. The issue only occurs when configuring the custom start command.
12 Replies
2 years ago
That’s the problem; there are no error logs, and nothing indicates what went wrong. Simply by configuring it, after the command runs, the server becomes unusable.
2 years ago
Because that command does not start a server, you need two services, one to run the server and one to run the schedule.
2 years ago
I previously scheduled a cron job with that command. The cron job was running that command every 24 hours, and everything was working. But now I'm encountering that error. Any ideas on how to implement what I need?
2 years ago
You need two Railway services, one to run the server and one to run the schedule.
2 years ago
So, does this mean I should create exactly another project with the same program, connected to the same database, but with this one only running the tasks with php artisan schedule:run?
2 years ago
Would you be so kind to guide me a bit? It’s the last thing I need to do, and I haven’t been able to accomplish it. I would greatly appreciate it.
2 years ago
Make sure you have your service set up to be a web server again, right click on your service, click duplicate, then change the start command.
2 years ago
Correct, then perform the deploy. What should I do next?
2 years ago
Thank you very much. I have now observed the functionality. From that service, it only runs the command and configures the cron. My time-related issue has been resolved. Thank you so much.
Status changed to Solved brody • over 1 year ago