From 533bbf1f617d6e8cbf7bde4d33f6e3c6f17897f6 Mon Sep 17 00:00:00 2001 From: Richard Foltin Date: Tue, 8 Aug 2017 23:38:44 +0200 Subject: [PATCH 1/2] webhook bug fix --- pogom/models.py | 2 +- pogom/webhook.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pogom/models.py b/pogom/models.py index 2d6c26ff09..e0a3317dea 100644 --- a/pogom/models.py +++ b/pogom/models.py @@ -2130,7 +2130,7 @@ def parse_map(args, map_dict, step_location, db_update_queue, wh_update_queue, wh_pokestop = pokestops[f.id].copy() wh_pokestop.update({ 'pokestop_id': b64encode(str(f.id)), - 'last_modified_time': f.last_modified_timestamp_ms, + 'last_modified': f.last_modified_timestamp_ms, 'lure_expiration': l_e, }) wh_update_queue.put(('pokestop', wh_pokestop)) diff --git a/pogom/webhook.py b/pogom/webhook.py index 21cd5e2385..e333b582bd 100644 --- a/pogom/webhook.py +++ b/pogom/webhook.py @@ -68,6 +68,7 @@ def wh_updater(args, queue, key_caches): frame_interval_sec = (args.wh_frame_interval / 1000) frame_first_message_time_sec = default_timer() frame_messages = [] + first_message = True # How low do we want the queue size to stay? wh_warning_threshold = 100 @@ -130,8 +131,9 @@ def wh_updater(args, queue, key_caches): now = default_timer() num_messages = len(frame_messages) - if num_messages == 1: + if num_messages == 1 and first_message: frame_first_message_time_sec = now + first_message = False # If enough time has passed, send the message frame. time_passed_sec = now - frame_first_message_time_sec @@ -144,6 +146,7 @@ def wh_updater(args, queue, key_caches): send_to_webhooks(args, session, frame_messages) frame_messages = [] + first_message = True # Webhook queue moving too slow. if (not wh_over_threshold) and ( From ead1b85d7203ca659a7b3dabd98232ed17e5e86f Mon Sep 17 00:00:00 2001 From: Richard Foltin Date: Thu, 11 Jan 2018 22:28:33 +0100 Subject: [PATCH 2/2] Captcha request fix --- pogom/captcha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pogom/captcha.py b/pogom/captcha.py index 88b15ac84a..2445392bc6 100644 --- a/pogom/captcha.py +++ b/pogom/captcha.py @@ -86,7 +86,7 @@ def captcha_overseer_thread(args, account_queue, account_captchas, t = Thread(target=captcha_solver_thread, name='captcha-solver-{}'.format(solverId), - args=(args, account_queue, account_captchas, + args=(args, account_queue, account_captchas, account, hash_key, wh_queue)) t.daemon = True t.start()