Starting Celery on Production
Good day, I am trying to integrate celery and redis into a Django project that performs background tasks.
The project works fine on the development server, I have tried to use the railway cli to start the celery worker and beat, but the process does work correctly.
That is once I close the cli the celery worker and beat stops working.
How can I achieve this.
Solution:Jump to solution
you want two railway services in the same railway project.
one railway service will be for just for django
the other railway service will be just for celery
the two railway services will have all the same service variables
the two railway services will deploy from the same github repository...
17 Replies
Project ID:
43cdf491-3552-4768-a29e-590c8f31e84c
If project ID is the same as service ID then 43cdf491-3552-4768-a29e-590c8f31e84c
Project ID:
43cdf491-3552-4768-a29e-590c8f31e84c
the cli runs commands locally using the env vars on Railway, it does not run the command on Railways servers
ssh access is not possible on Railway, you’ll have to find another way to start your workers
you create another empty railway service in your pre existing project, set the appropriate start command for celery in the service settings, set up all the needed service variables, and then attach your github repo in the service settings, it will then deploy and start celery
Please explain more on how to do this.
Please explain more on how to do this.
that is the explanation
@Godisgreat thanks I have been able to make progress.
How Can I have more than one start command
set the appropriate start command for celery in the service settings
The second service you talk about how should I do it
in the service settings, like i have already mentioned
@Brody Please I am having a hard time doing this I will send some pictures of what my setup looks like
Solution
you want two railway services in the same railway project.
one railway service will be for just for django
the other railway service will be just for celery
the two railway services will have all the same service variables
the two railway services will deploy from the same github repository
the django railway service will have a start command set to start only django
the celery railway service will have a start command set to start only celery
the start command input field can be found in the service settings of the railway service
im sorry but i dont know how i could explain this better unless i took control of your computer and did it for you
@Brody if I get what you are saying I will deploy my project twice and set the celery worker command on one right?
please no pings #🛂|readme #5
as previously mentioned you need two railway services in your current railway project, if you don't know how to add a service there is a
+ New
button in the top right of the project viewOkay thanks
Sovled