Browse Source

fsck: increase max restarts from 100 to 1000

This is effectively the number of problems with the database that can
be fixed, since we restart fsck after each one.
tags/nilmdb-2.2.0
Jim Paris 8 months ago
parent
commit
e90a79ddad
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      nilmdb/fsck/fsck.py

+ 2
- 2
nilmdb/fsck/fsck.py View File

@@ -52,7 +52,7 @@ def err(format, *args):


# Decorator that retries a function if it returns a specific value
def retry_if_raised(exc, message=None, max_retries=100):
def retry_if_raised(exc, message=None, max_retries=1000):
def f1(func):
def f2(*args, **kwargs):
for n in range(max_retries):
@@ -60,7 +60,7 @@ def retry_if_raised(exc, message=None, max_retries=100):
return func(*args, **kwargs)
except exc:
if message:
log("%s\n\n", message)
log(f"{message} ({n+1})\n\n")
raise Exception("Max number of retries (%d) exceeded; giving up" %
max_retries)
return f2


Loading…
Cancel
Save