Browse Source

修改date_string

luojunhui 2 months ago
parent
commit
47f18e2fb9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      applications/tasks/task_scheduler.py

+ 2 - 2
applications/tasks/task_scheduler.py

@@ -2,7 +2,7 @@ import asyncio
 import json
 import time
 import traceback
-from datetime import datetime
+from datetime import datetime, timedelta
 from typing import Awaitable, Callable, Dict
 
 from applications.api import feishu_robot
@@ -151,7 +151,7 @@ class TaskScheduler(TaskHandler):
                 "4003", "task_name must be input"
             )
 
-        date_str = self.data.get("date_string") or datetime.now().strftime("%Y-%m-%d")
+        date_str = self.data.get("date_string") or (datetime.utcnow() + timedelta(hours=8)).strftime("%Y-%m-%d")
 
         # === 所有任务在此注册:映射到一个返回 int 状态码的异步函数 ===
         handlers: Dict[str, Callable[[], Awaitable[int]]] = {