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