This commit is contained in:
NianBroken
2024-07-15 20:17:28 +08:00 Unverified
parent 0c6c3a0db4
commit 46b8b2edf0
+1 -1
View File
@@ -44,7 +44,7 @@ class GitHubActionsManager:
run_time = datetime.strptime(run["created_at"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc) run_time = datetime.strptime(run["created_at"], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)
# 计算当前时间与运行记录创建时间的差值 # 计算当前时间与运行记录创建时间的差值
time_difference = self.current_time - run_time time_difference = self.current_time - run_time
if time_difference > timedelta(hours=168): # 如果差值超过168小时 if time_difference > timedelta(hours=100): # 如果差值超过168小时
self.delete_run(run["id"]) # 删除运行记录 self.delete_run(run["id"]) # 删除运行记录
else: # 如果请求失败 else: # 如果请求失败
self.log(f"Failed to fetch runs. Status code: {response.status_code}") # 打印错误信息 self.log(f"Failed to fetch runs. Status code: {response.status_code}") # 打印错误信息