Hey,

I want to use gevent pool instead of celery default prefork I added the -P flag with gevent however I keep getting this error.

rker[16712]: [2019-01-21 11:06:45,643][PID:1][ERROR][MainProcess] Task 
redash.tasks.refresh_queries[881e5d0b-a896-4202-9312-9e57986362
rker[16712]: Traceback (most recent call last):
rker[16712]:   File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 382, in trace_task
rker[16712]:     R = retval = fun(*args, **kwargs)
rker[16712]:   File "/app/redash/worker.py", line 70, in __call__
rker[16712]:     with current_app.app_context():
rker[16712]:   File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 343, in __getattr__
rker[16712]:     return getattr(self._get_current_object(), name)
rker[16712]:   File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 302, in _get_current_object
rker[16712]:     return self.__local()
rker[16712]:   File "/usr/local/lib/python2.7/dist-packages/flask/globals.py", line 51, in _find_app
rker[16712]:     raise RuntimeError(_app_ctx_err_msg)
rker[16712]: RuntimeError: Working outside of application context.

Can you let me know what I am doing wrong, or point out the piece of code I might have to modify regarding this.

I also did the monkey patch in the worker.py file as per the celery documentation.

It might be related to this: