|
437 | 437 |
|
438 | 438 | # Celery |
439 | 439 | # http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html |
| 440 | +# |
| 441 | +# A note of REDIS_URL and CELERY_BROKER_URL formats for connections utilzing TLS |
| 442 | +# |
| 443 | +# For connections NOT utilzing TLS, setting JUST 'REDIS_URL' should be sufficient. |
| 444 | +# |
| 445 | +# For connections that DO utilize TLS, we need to make some special accomodations |
| 446 | +# for how two different methods of connecting to Redis are used. |
| 447 | +# |
| 448 | +# REDIS_URL Format (aka 'uppercase constant') |
| 449 | +# rediss://<username>:<password>@<redis-hostname>:6379/<DB#>?ssl_cert_reqs=CERT_REQUIRED |
| 450 | +# |
| 451 | +# CELERY_BROKER_URL Format (aka 'lowercase literal') |
| 452 | +# rediss://<username>:<password>@<redis-hostname>:6379/<DB#>?ssl_cert_reqs=required |
| 453 | +# |
| 454 | +# CACHES.REDIS.LOCATION= lowercase literal |
| 455 | +# CELERY_RESULT_BACKEND = uppercase constant |
| 456 | +# CELERY_REDBEAT_REDIS_URL = lowercase literal |
| 457 | +# |
440 | 458 | REDIS_URL = get_string("REDIS_URL", None) |
441 | 459 | REDIS_MAX_CONNECTIONS = get_int("REDIS_MAX_CONNECTIONS", 65000) |
442 | 460 | USE_CELERY = True |
443 | 461 | CELERY_BROKER_URL = get_string("CELERY_BROKER_URL", REDIS_URL) |
444 | 462 | CELERY_RESULT_BACKEND = REDIS_URL |
445 | 463 | CELERY_BEAT_SCHEDULER = RedBeatScheduler |
446 | | -CELERY_REDBEAT_REDIS_URL = REDIS_URL |
| 464 | +CELERY_REDBEAT_REDIS_URL = CELERY_BROKER_URL |
447 | 465 |
|
448 | 466 | CELERY_TASK_ALWAYS_EAGER = get_bool("CELERY_TASK_ALWAYS_EAGER", False) |
449 | 467 | CELERY_TASK_EAGER_PROPAGATES = get_bool("CELERY_TASK_EAGER_PROPAGATES", True) |
|
480 | 498 | }, |
481 | 499 | "redis": { |
482 | 500 | "BACKEND": "django_redis.cache.RedisCache", |
483 | | - "LOCATION": REDIS_URL, |
| 501 | + "LOCATION": CELERY_BROKER_URL, |
484 | 502 | "OPTIONS": { |
485 | 503 | "CLIENT_CLASS": "django_redis.client.DefaultClient", |
486 | 504 | "CONNECTION_POOL_KWARGS": {"max_connections": REDIS_MAX_CONNECTIONS}, |
|
0 commit comments