Skip to content

Commit 0ff6e5b

Browse files
authored
Merge pull request jekirl#55 from paulsena/master
Added retry logic if login fails
2 parents ec8a160 + da0281d commit 0ff6e5b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pokecli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ def main():
119119
# provide player position on the earth
120120
api.set_position(*position)
121121

122-
if not api.login(config.auth_service, config.username, config.password, config.cached):
123-
return
122+
# retry login every 30 seconds if any errors
123+
while not api.login(config.auth_service, config.username, config.password, config.cached):
124+
log.error('Retrying Login in 30 seconds')
125+
sleep(30)
126+
127+
# main loop
124128
while True:
125129
try:
126130
api.main_loop()

0 commit comments

Comments
 (0)