skip to Main Content

Redis – Celery with Flask and UWSGI

I have a simple application flask with a simple celery task: from flask import Flask from celery import Celery app = Flask(__name__) app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379' app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379' celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL']) celery.conf.update(app.config) @celery.task def add(x, y): return x +…

VIEW QUESTION

Celery not executing new tasks if redis lost connection is restablished

I have a Celery worker configured to connect to redis as follows: celery_app_site24x7 = Celery('monitoringExterne.celerys.site24x7', broker=settings.REDIS['broker'], backend=settings.REDIS['backend']) celery_app_site24x7.conf.broker_transport_options = { 'visibility_timeout': 36000 } celery_app_site24x7.conf.socket_timeout = 300 celery_app_site24x7.conf.broker_connection_max_retries = None celery_app_site24x7.config_from_object('django.conf:settings') celery_app_site24x7.autodiscover_tasks(lambda: settings.INSTALLED_APPS) The issue is that if Redis is down…

VIEW QUESTION

Redis – Importing Celery in Flask Blueprints

I have a Flask Application with an MVC structure: my_app ├── server.py ├── requirements.txt ├── models │ ├── __init__.py └── model.py ├── controllers ├── __init__.py ├── client_controllers └──controller.py └── another_controller.py └── templates I use blueprints to split the server code…

VIEW QUESTION

Redis – Why celery beat doesn't schedule periodic tasks?

I've followed the celery doc https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html to create an app and periodic tasks as below: $ tree demo/ demo/ ├── config.py ├── __init__.py └── tasks.py $ cat demo/__init__.py # -*- coding: utf-8 -*- from celery import Celery app = Celery('demo')…

VIEW QUESTION
Back To Top
Search