diff --git a/config.py.example b/config.py.example index 53f1541cf5..70e09f2fc4 100644 --- a/config.py.example +++ b/config.py.example @@ -7,8 +7,9 @@ MAP_START = (12.3456, 34.5678) MAP_END = (13.4567, 35.6789) GRID = (2, 2) # row, column CYCLES_PER_WORKER = 3 +SCAN_DELAY = 10 # seconds -SCAN_RADIUS = 70 +SCAN_RADIUS = 70 # metres ACCOUNTS = [ ('ash_ketchum', 'pik4chu', 'ptc'), diff --git a/worker.py b/worker.py index e9ce2a0a61..0df23224c5 100644 --- a/worker.py +++ b/worker.py @@ -28,6 +28,7 @@ 'GRID', 'ACCOUNTS', 'SCAN_RADIUS', + 'SCAN_DELAY', ) for setting_name in REQUIRED_SETTINGS: if not hasattr(config, setting_name): @@ -186,7 +187,9 @@ def main(self): if self.error_code and self.seen_per_cycle: self.error_code = None self.step += 1 - time.sleep(random.uniform(5, 7)) + time.sleep( + random.uniform(config.SCAN_DELAY, config.SCAN_DELAY + 2) + ) session.close() if self.seen_per_cycle == 0: self.error_code = 'NO POKEMON'