feat: plugin OAuth with stateful

This commit is contained in:
Harry
2025-06-20 10:34:57 +08:00
parent 366ddb05ae
commit 12c20ec7f6
15 changed files with 809 additions and 72 deletions

View File

@ -1,3 +1,4 @@
import os
from datetime import timedelta
import pytz
@ -24,12 +25,17 @@ def init_app(app: DifyApp) -> Celery:
},
}
flask_debugging = os.environ.get("FLASK_DEBUG", "0").lower() in {"true", "1", "yes"}
celery_app = Celery(
app.name,
task_cls=FlaskTask,
broker=dify_config.CELERY_BROKER_URL,
backend=dify_config.CELERY_BACKEND,
task_ignore_result=True,
task_always_eager=flask_debugging,
task_eager_propagates=flask_debugging,
)
# Add SSL options to the Celery configuration