Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celery worker log format following LOG_FORMAT env#9404 #10016

Merged
merged 10 commits into from
Nov 8, 2024
6 changes: 6 additions & 0 deletions api/extensions/ext_celery.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import timedelta

import pytz
from celery import Celery, Task
from celery.schedules import crontab
from flask import Flask
Expand Down Expand Up @@ -43,6 +44,11 @@ def __call__(self, *args: object, **kwargs: object) -> object:
result_backend=dify_config.CELERY_RESULT_BACKEND,
broker_transport_options=broker_transport_options,
broker_connection_retry_on_startup=True,
worker_log_format=dify_config.LOG_FORMAT,
worker_task_log_format=dify_config.LOG_FORMAT,
worker_logfile=dify_config.LOG_FILE,
worker_hijack_root_logger=False,
timezone=pytz.timezone(dify_config.LOG_TZ),
)

if dify_config.BROKER_USE_SSL:
Expand Down
21 changes: 11 additions & 10 deletions api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ beautifulsoup4 = "4.12.2"
boto3 = "1.35.17"
bs4 = "~0.0.1"
cachetools = "~5.3.0"
celery = "~5.3.6"
celery = "~5.4.0"
liuhaoran1212 marked this conversation as resolved.
Show resolved Hide resolved
chardet = "~5.1.0"
cohere = "~5.2.4"
dashscope = { version = "~1.17.0", extras = ["tokenizer"] }
Expand Down
Loading