Skip to content

Commit e3fb5bd

Browse files
committed
dashboard: Add delay with exp() backoff to prevent flooding backend
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent 9349ab8 commit e3fb5bd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

kcidev/libs/dashboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def wrapper(
4444
logging.warning(
4545
f"Retrying request due to status {r.status_code} (attempt {retries}/{max_retries})"
4646
)
47+
# Delay before retrying, to prevent hammering the server with exponential backoff
48+
time.sleep(2**retries)
4749
continue
4850
else:
4951
logging.error(

0 commit comments

Comments
 (0)