From 016fa1e19b2265babe98cec43404c2f992336b34 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Tue, 11 Apr 2023 04:39:28 -0400 Subject: ci: run wf cache clear script twice with delays (#1093) * ci: run wf cache clear script twice with delays * reduce --- scripts/clear_cache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/clear_cache.py b/scripts/clear_cache.py index 2c40f76c..39cebe36 100644 --- a/scripts/clear_cache.py +++ b/scripts/clear_cache.py @@ -4,9 +4,10 @@ # # Expects a GitHub token in the environment variables as GITHUB_TOKEN. -import os import json +import os import sys +import time from urllib.error import HTTPError, URLError from urllib.request import Request, urlopen @@ -53,6 +54,7 @@ def main(): print("URLError with delete.") else: print("Successfully deleted cache ID {}!".format(id)) + time.sleep(0.1) elif args[1] == "keep-main" or args[1] == "keep-master": print("Clearing all but default branch cache.") with urlopen(cache_list_request(key)) as response: @@ -70,6 +72,7 @@ def main(): print("URLError with delete.") else: print("Successfully deleted cache ID {}!".format(id)) + time.sleep(0.1) elif args[1] == "main" or args[1] == "master" or args[1] == "all": print("Clearing all caches.") with urlopen(cache_list_request(key)) as response: @@ -86,6 +89,7 @@ def main(): print("URLError with delete.") else: print("Successfully deleted cache ID {}!".format(id)) + time.sleep(0.1) else: print(f"Skipping, given argument {args[1]}.") -- cgit v1.2.3