Fix scheduled cron trigger timestamp formatting

This commit is contained in:
Rixuan Shao
2026-05-21 21:41:29 +08:00
parent e72aa8fa12
commit 94ac6eb54b

View File

@@ -72,7 +72,7 @@ def build_task_run_spec():
def build_scheduled_task_command():
if running_in_container():
return (
"/bin/bash -lc 'timestamp=$(date \"+%F %T %Z\"); "
"/bin/bash -lc 'timestamp=$(date -Iseconds); "
"echo \"[AUTO_TRIGGER] $timestamp scheduled send start\"; "
"container=$(docker ps --format \"{{.Names}}\" | "
"grep -E \"^(douyin-web-hostfix|douyin-web)$\" | head -n 1); "
@@ -88,14 +88,14 @@ def build_scheduled_task_command():
compose_root_quoted = shlex.quote(str(compose_root()))
return (
"/bin/bash -lc "
f"'echo \"[AUTO_TRIGGER] $(date \"+%F %T %Z\") compose task start\"; "
f"'echo \"[AUTO_TRIGGER] $(date -Iseconds) compose task start\"; "
f"cd {compose_root_quoted} && /usr/bin/docker compose run --rm task'"
)
repo_root_quoted = shlex.quote(str(repo_root()))
python_quoted = shlex.quote(sys.executable)
return (
"/bin/bash -lc "
f"'echo \"[AUTO_TRIGGER] $(date \"+%F %T %Z\") local task start\"; "
f"'echo \"[AUTO_TRIGGER] $(date -Iseconds) local task start\"; "
f"cd {repo_root_quoted} && {python_quoted} main.py --doTask'"
)