chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,30 @@
|
||||
"""Retired entry point of the previous trace pipeline.
|
||||
|
||||
Producers from before an upgrade may still enqueue this task. Its payload uses
|
||||
the previous record format, so the message is dropped and its payload deleted;
|
||||
only old workers can export it. Keep new workers off the old queue until it has
|
||||
drained. The new pipeline's sweeper leaves legacy payloads alone.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import re
|
||||
|
||||
from celery import shared_task
|
||||
|
||||
from extensions.ext_storage import storage
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_PAYLOAD_SEGMENT = re.compile(r"[A-Za-z0-9-]+")
|
||||
|
||||
|
||||
@shared_task(queue="ops_trace")
|
||||
def process_trace_tasks(file_info: dict[str, object]) -> None:
|
||||
app_id, file_id = file_info.get("app_id"), file_info.get("file_id")
|
||||
if isinstance(app_id, str) and isinstance(file_id, str):
|
||||
if _PAYLOAD_SEGMENT.fullmatch(app_id) and _PAYLOAD_SEGMENT.fullmatch(file_id):
|
||||
try:
|
||||
storage.delete(f"ops_trace/{app_id}/{file_id}.json")
|
||||
except Exception:
|
||||
logger.warning("Legacy trace payload cleanup failed: app_id=%s", app_id, exc_info=True)
|
||||
logger.info("Dropped a trace task enqueued before the trace pipeline upgrade: app_id=%s", app_id)
|
||||
Reference in new issue
Block a user