Skip to content

Commit

Permalink
SCAN_DELAY config
Browse files Browse the repository at this point in the history
Oh Niantic Niantic, why do you always introduce changes like that just
as I'm falling asleep?
  • Loading branch information
modrzew committed Aug 3, 2016
1 parent 01baeac commit 2055388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
5 changes: 4 additions & 1 deletion worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'GRID',
'ACCOUNTS',
'SCAN_RADIUS',
'SCAN_DELAY',
)
for setting_name in REQUIRED_SETTINGS:
if not hasattr(config, setting_name):
Expand Down Expand Up @@ -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'
Expand Down

1 comment on commit 2055388

@andrewbroberg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha cheers for getting that updated quickly :)

Please sign in to comment.