Skip to content

Commit

Permalink
Fixes #2698 - Prevents "Possibly searching too often" error after re-…
Browse files Browse the repository at this point in the history
…login. (#2771)

* Fixes #2698
- Added api.activate_signature call to prevent issue after re-login.
- Also replaced deprecated log call with event_manager emit to prevent exception being thrown.

* Modified to use OS detected library path as per PR #2768
  • Loading branch information
geek-man authored and douglascamata committed Aug 7, 2016
1 parent 4eb7b38 commit 6960f35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,17 @@ def check_session(self, position):
self.api._auth_provider._ticket_expire / 1000 - time.time()

if remaining_time < 60:
self.logger.info("Session stale, re-logging in", 'yellow')
self.event_manager.emit(
'api_error',
sender=self,
level='info',
formatted='Session stale, re-logging in.'
)
position = self.position
self.api = ApiWrapper()
self.position = position
self.login()
self.api.activate_signature(self.get_encryption_lib())

@staticmethod
def is_numeric(s):
Expand Down

0 comments on commit 6960f35

Please sign in to comment.