refactor: consolidate pending recovery checks (#101)
This commit is contained in:
@@ -522,12 +522,10 @@ def run_collection(
|
||||
while True:
|
||||
conn.execute("BEGIN IMMEDIATE")
|
||||
waiting = _pending_count(conn)
|
||||
if waiting >= PENDING_PUBLICATION_LIMIT:
|
||||
conn.rollback()
|
||||
published_count += _recover_pending_for_admission(conn)
|
||||
checked_pending_count = _pending_count(conn)
|
||||
continue
|
||||
if waiting > checked_pending_count:
|
||||
if (
|
||||
waiting >= PENDING_PUBLICATION_LIMIT
|
||||
or waiting > checked_pending_count
|
||||
):
|
||||
conn.rollback()
|
||||
published_count += _recover_pending_for_admission(conn)
|
||||
checked_pending_count = _pending_count(conn)
|
||||
|
||||
Reference in New Issue
Block a user