diff --git a/.gitea/workflows/multi-repo-sync.yml b/.gitea/workflows/multi-repo-sync.yml index 1413231..8e885d6 100644 --- a/.gitea/workflows/multi-repo-sync.yml +++ b/.gitea/workflows/multi-repo-sync.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: schedule: # 每天凌晨1点执行 - - cron: '0 1 * * *' + - cron: '0 1 * * 0' env: CONFIG_FILE: 'repos.yaml' diff --git a/sync_repos.py b/sync_repos.py index b5abd03..3a26499 100644 --- a/sync_repos.py +++ b/sync_repos.py @@ -88,7 +88,7 @@ def sync_repository(repo_config): print(f"\n[1/6] 克隆目标仓库...") result = subprocess.run( ['git', 'clone', target_url, work_dir], - capture_output=True, text=True, timeout=300 + capture_output=True, text=True, timeout=3600 ) if result.returncode != 0: print(f"❌ 克隆目标仓库失败:") @@ -112,7 +112,7 @@ def sync_repository(repo_config): try: result = subprocess.run( ['git', 'fetch', 'upstream'], - capture_output=True, text=True, timeout=200 + capture_output=True, text=True, timeout=3600 ) if result.returncode == 0: break @@ -166,7 +166,7 @@ def sync_repository(repo_config): print(f"[6/6] 推送到目标仓库...") result = subprocess.run( ['git', 'push', '--force', '--tags', 'origin', f'refs/heads/{branch}'], - capture_output=True, text=True, timeout=600 + capture_output=True, text=True, timeout=3600 ) if result.returncode != 0: print(f"❌ 推送到目标仓库失败:")