Skip to content

Commit

Permalink
remove result_expires
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Kehl committed Dec 19, 2024
2 parents cfe9b11 + 7c7f96d commit 6134530
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging as real_logging
import os
import secrets
import string
Expand Down Expand Up @@ -36,6 +37,9 @@ def init_app(self, app):

# Configure Celery app with options from the main app config.
self.config_from_object(app.config["CELERY"])
self.conf.worker_hijack_root_logger = False
logger = real_logging.getLogger("celery")
logger.propagate = False

def send_task(self, name, args=None, kwargs=None, **other_kwargs):
other_kwargs["headers"] = other_kwargs.get("headers") or {}
Expand Down
1 change: 0 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class Config(object):
CELERY = {
"worker_max_tasks_per_child": 500,
"task_ignore_result": True,
"result_expires": 0,
"result_persistent": False,
"broker_url": REDIS_URL,
"broker_transport_options": {
Expand Down
2 changes: 2 additions & 0 deletions notifications_utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ def init_app(app):
for logger_instance, handler in product(loggers, handlers):
logger_instance.addHandler(handler)
logger_instance.setLevel(loglevel)
logger_instance.propagate = False
warning_loggers = [logging.getLogger("boto3"), logging.getLogger("s3transfer")]
for logger_instance, handler in product(warning_loggers, handlers):
logger_instance.addHandler(handler)
logger_instance.setLevel(logging.WARNING)
logger_instance.propagate = False

# Suppress specific loggers to prevent leaking sensitive info
logging.getLogger("boto3").setLevel(logging.ERROR)
Expand Down

0 comments on commit 6134530

Please sign in to comment.