From a5c24cc20b0d9a272c8c582f6a60b02f786a232c Mon Sep 17 00:00:00 2001 From: weaigc <879821485@qq.com> Date: Tue, 12 Sep 2023 20:45:20 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E8=B0=83=E6=95=B4endpoint=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync-endpoint.yml | 2 +- sync/sync.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-endpoint.yml b/.github/workflows/sync-endpoint.yml index 4db642b2..ed042e43 100644 --- a/.github/workflows/sync-endpoint.yml +++ b/.github/workflows/sync-endpoint.yml @@ -1,7 +1,7 @@ name: Sync Endpoint on: schedule: - - cron: '0 22 * * *' + - cron: '* */24 * * *' jobs: sync-to-hub: diff --git a/sync/sync.py b/sync/sync.py index bce17a2a..4a681ff0 100644 --- a/sync/sync.py +++ b/sync/sync.py @@ -13,7 +13,10 @@ with open(file,"r") as f: content=f.read().strip() print('content:', content) - endpointIndex = '1' if content == '0' else '0' + index = int(content) + 1 + if index >= len(endpoints): + index = 0 + endpointIndex = str(index) f.close() except IOError: print("File not accessible")