From f700c92b570ed2dcaec58fdbc448b4806b561bd7 Mon Sep 17 00:00:00 2001 From: "Melvin D. Protacio" Date: Sat, 9 Dec 2023 15:19:27 +0800 Subject: [PATCH] trying to fix rate limiting --- .github/workflows/dockerhub.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index f221e80..ab93c3e 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -87,9 +87,8 @@ jobs: script: | console.log("About to clear") let caches = null - let loop = 0; + const sleep = ms => new Promise(r => setTimeout(r, ms)); do { - console.log("Iteration: " + loop) caches = await github.rest.actions.getActionsCacheList({ owner: context.repo.owner, repo: context.repo.repo, @@ -105,6 +104,7 @@ jobs: cache_id: cache.id, }) } - loop++ - } while(caches && loop < 2) + //sleep 30 seconds before iterating again, to combat ratelimitting + await sleep(30000) + } while(caches) console.log("Clear completed") \ No newline at end of file