def make_celery(app): celery = Celery( app.import_name, backend=app.config['CELERY_RESULT_BACKEND'], broker=app.config['CELERY_BROKER_URL'] ) celery.conf.update(app.config) class ContextTask(celery.Task): def __call__(self, *args, **kwargs): with app.app_context(): return self.run(*args, **kwargs) celery.Task = ContextTask return celery app = Flask(__name__) app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' app.secret_key = '6969' api = Api(app) celery = Celery(app.name, broker=app.config['CELERY_BROKER_URL']) celery.conf.update(app.config)
@celery.task def send(): p = subprocess.run(['python3 calc.py'], cwd=r"/var/www/webApp/webApp/", shell=True,stdin=None, stdout=None, stderr=None, close_fds=True) returnmy issue and the only error i can see to access: Object of type 'module' is not JSON serializable
anyone help?