Fix instance buffer size

This commit is contained in:
Piotr Krygier committed 2025-06-20 13:44:33 +02:00
1 parent b2508ce4ff
commit 99d7546e3d
8 files changed
+24 -22

No files matched your search

+12 -7
View File
@@ -35,19 +35,24 @@ class Dependency:
break
def download(self):
dl_counter = 0
# Git repository
if hasattr(self, "git_url") and self.git_url:
repo = git.Repo.clone_from(self.git_url, os.path.join(REPO_DIR, self.name))
repo.git.checkout(self.tag)
elif hasattr(self, "dl_url") and self.dl_url:
response = requests.get(self.dl_url)
if response.status_code == 200: # everything went fine
open(os.path.join(REPO_DIR, self.name), "wb").write(response.content)
while dl_counter < 10:
response = requests.get(self.dl_url)
if response.status_code == 200: # everything went fine
open(os.path.join(REPO_DIR, self.name), "wb").write(response.content)
break
dl_counter += 1
print("Failed to download {}. Retrying {}th time...", self.name, dl_counter)
time.sleep(5.0)
if hasattr(self, "custom_commands") and self.custom_commands:
p = subprocess.Popen(self.custom_commands, shell=True)
p = subprocess.run(self.custom_commands, shell=True)
p.chek_returncode()
def main():
if not os.path.isdir(REPO_DIR):
@@ -77,4 +82,4 @@ def main():
if __name__ == "__main__":
main()
main()