From d3527212082fa140e7e57d25c085c0a992027da7 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 d51fa1d0..4adc4a7a 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))