From 09b14e1702426ce4ef6ce6b6339a3d669584706d Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Mon, 16 Dec 2024 15:56:36 +0100 Subject: [PATCH] [FIX] runbot: add timeout to request For a strange reason, the runbot got stuck while updating a ci status. The reason why it occurs know just after the upgrade is unknown, but adding a timeout may help to mitigate this issue. --- runbot/models/repo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index 2b6e95cd..278a9be1 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -278,9 +278,9 @@ class Remote(models.Model): while try_count < nb_tries: try: if payload: - response = session.post(url, data=json.dumps(payload)) + response = session.post(url, data=json.dumps(payload), timeout=20) else: - response = session.get(url) + response = session.get(url, timeout=20) response.raise_for_status() if try_count > 0: _logger.info('Success after %s tries', (try_count + 1))