Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celery support #147

Open
therealjr opened this issue Jun 19, 2020 · 3 comments
Open

celery support #147

therealjr opened this issue Jun 19, 2020 · 3 comments

Comments

@therealjr
Copy link

therealjr commented Jun 19, 2020

I'm trying to integrate some new features into the software such as task queue's and infinite scrolling. I've got a lot of it written but currently cannot find where to start my celery task. I call the celery function that is written in app.py from within Firehouse.py since it is called after the server has started. However I cannot find the interface which the redis server is listening on. How exactly can I reach redis' sockets?

@DangerOnTheRanger
Copy link
Owner

Which port redis is using (as well as its hostname) is dependent on how you've set up redis via docker-compose (or an alternative orchestration tool) - when using the docker-compose.yml shipped in the repository, you should be able to access it simply via the hostname redis when inside the Docker container network - so from code running in the main Maniwani container, for instance. If you've kept the redis section of your docker-compose.yml the same as it is in repo here, then the port should be redis default, which is 6379.

@therealjr
Copy link
Author

Thank you for your response. I think my problem is better described here

@DangerOnTheRanger
Copy link
Owner

The connection being refused could be caused by the Maniwani container reaching the point where it tries to connect to redis before the redis container can be set up, but that's just a theory. I'd suggest adding a small standalone script (either via docker cp or via amending the Maniwani Dockerfile) that just tests redis and celery, and perhaps just redis alone if possible, and then running it after you're certain redis is up and running, via docker-compose exec or some other mechanism. If it works, then Maniwani is probably starting up.

How would you go about fixing this problem, if it were to be the culprit? Waiting to see if the redis port was open from the shell script that the Maniwani container uses to boot up uWSGI/Flask (build-helpers/docker-entrypoint.sh) and don't start Maniwani proper until after you can make a connection to redis. The captchouli container has similar code if you need some inspiration.

Figuring how when/where to call celery.task.delay can come after this gets sorted out, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants