Skip to content

Commit

Permalink
Save previous worker status to database. Fixes #1749 (#1778)
Browse files Browse the repository at this point in the history
Previously we could have inconsistencies since stats
from a worker that failed would not be stored in the db,
like captchas and non empty
  • Loading branch information
onilton authored and sebastienvercammen committed Jan 29, 2017
1 parent 94dfd50 commit f55ad0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pogom/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,10 @@ def search_worker_thread(args, account_queue, account_failures,
# This reinitializes the API and grabs a new account from the queue.
while True:
try:
# Force storing of previous worker info to keep consistency
if 'starttime' in status:
dbq.put((WorkerStatus, {0: WorkerStatus.db_format(status)}))

status['starttime'] = now()

# Track per loop.
Expand Down

0 comments on commit f55ad0e

Please sign in to comment.