forked from LBRYCommunity/lbry-sdk
delay re-running query after database locked error
This commit is contained in:
parent
476a44ddb5
commit
bceaaa5724
1 changed files with 2 additions and 1 deletions
|
@ -78,7 +78,8 @@ def rerun_if_locked(f):
|
||||||
log.warning("database was locked. rerunning %s with args %s, kwargs %s",
|
log.warning("database was locked. rerunning %s with args %s, kwargs %s",
|
||||||
str(f), str(args), str(kwargs))
|
str(f), str(args), str(kwargs))
|
||||||
if rerun_count < max_attempts:
|
if rerun_count < max_attempts:
|
||||||
return task.deferLater(reactor, 0, inner_wrapper, rerun_count + 1, *args, **kwargs)
|
delay = 2**rerun_count
|
||||||
|
return task.deferLater(reactor, delay, inner_wrapper, rerun_count + 1, *args, **kwargs)
|
||||||
raise err
|
raise err
|
||||||
|
|
||||||
def inner_wrapper(rerun_count, *args, **kwargs):
|
def inner_wrapper(rerun_count, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue