修改了上传页面点击的逻辑;增加循环

This commit is contained in:
2026-03-05 14:32:37 +08:00
parent cfafb9d3d4
commit e285191149
21 changed files with 17440 additions and 17158 deletions

View File

@@ -52,7 +52,7 @@ def update_file_status(username, from_status, to_status):
def parse_time_config():
"""
解析 time.txt只获取状态为 true 的任务
解析 time.txt只获取状态为 ok 的任务
"""
time_map = {}
if not os.path.exists(TIME_FILE_PATH):
@@ -64,8 +64,8 @@ def parse_time_config():
with open(TIME_FILE_PATH, 'r', encoding='utf-8') as f:
for line in f:
line = line.strip()
# 匹配:用户名 时间 true (仅获取待处理任务)
match = re.search(r'(\w+)\s+(\d{4}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}:\d{2})\s+ok$', line)
# 匹配:用户名 时间 ok (仅获取待处理任务)
match = re.search(r'([\w-]+)\s+(\d{4}-\d{1,2}-\d{1,2}\s+\d{1,2}:\d{2}:\d{2})\s+ok$', line)
if match:
username, scheduled_time = match.group(1), match.group(2)
time_map[username] = scheduled_time
@@ -112,6 +112,7 @@ def get_combined_tasks():
"""
try:
local_times = parse_time_config()
print(f"📝 [文件解析]local_times: {local_times}")
if not local_times:
return {}
@@ -187,7 +188,7 @@ def run_task(address, target_time, username):
return f"{username} 执行异常: {str(e)}"
def monitor_center():
"""调度中心:每半小时检查一次"""
"""调度中心:每10分钟检查一次"""
while True:
now_str = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(f"\n{'='*20} 周期性检查开始 ({now_str}) {'='*20}")