Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
geek-man committed Aug 7, 2016
1 parent 0b319bc commit ed5666d
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("encrypt.so")

@staticmethod
def is_numeric(s):
Expand Down

0 comments on commit ed5666d

Please sign in to comment.