Skip to content
Snippets Groups Projects
Unverified Commit 635f0d91 authored by reivilibre's avatar reivilibre Committed by GitHub
Browse files

Do not keep going if there are 5 back-to-back background update failures. (#12781)

parent df496354
No related branches found
No related tags found
No related merge requests found
Do not keep going if there are 5 back-to-back background update failures.
\ No newline at end of file
......@@ -282,12 +282,20 @@ class BackgroundUpdater:
self._running = True
back_to_back_failures = 0
try:
logger.info("Starting background schema updates")
while self.enabled:
try:
result = await self.do_next_background_update(sleep)
back_to_back_failures = 0
except Exception:
back_to_back_failures += 1
if back_to_back_failures >= 5:
raise RuntimeError(
"5 back-to-back background update failures; aborting."
)
logger.exception("Error doing update")
else:
if result:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment