Skip to content

Commit

Permalink
Expose celery job timeout setting to env var (#3912)
Browse files Browse the repository at this point in the history
* Expose celery job timeout to env

* Change variable name
  • Loading branch information
deecay authored and arikfr committed Jun 19, 2019
1 parent a6960c5 commit be580b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redash/metrics/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import logging
import socket
import time
from redash import settings

from celery.concurrency import asynpool
asynpool.PROC_ALIVE_TIMEOUT = 10.0
asynpool.PROC_ALIVE_TIMEOUT = settings.CELERY_INIT_TIMEOUT

from celery.signals import task_postrun, task_prerun
from redash import settings, statsd_client
Expand Down
2 changes: 2 additions & 0 deletions redash/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
CELERY_RESULT_EXPIRES = int(os.environ.get(
"REDASH_CELERY_RESULT_EXPIRES",
os.environ.get("REDASH_CELERY_TASK_RESULT_EXPIRES", 3600 * 4)))
CELERY_INIT_TIMEOUT = int(os.environ.get(
"REDASH_CELERY_INIT_TIMEOUT", 10))
CELERY_BROKER_USE_SSL = CELERY_BROKER.startswith('rediss')
CELERY_SSL_CONFIG = {
'ssl_cert_reqs': int(os.environ.get("REDASH_CELERY_BROKER_SSL_CERT_REQS", ssl.CERT_OPTIONAL)),
Expand Down

0 comments on commit be580b2

Please sign in to comment.