Update the timer, and possibly issue a keepalive.
(self, params)
| 44 | logging.debug('Error reading logout timeout: %s', e) |
| 45 | |
| 46 | def update(self, params): |
| 47 | """Update the timer, and possibly issue a keepalive.""" |
| 48 | if not params.session_token: |
| 49 | return |
| 50 | |
| 51 | current_time = time.time() |
| 52 | |
| 53 | self.lookup_server_logout_window(params) |
| 54 | |
| 55 | if ( |
| 56 | self.server_logout_timer_window is not None and |
| 57 | (self.server_logout_timer_window / 2) + self.time_of_last_activity < current_time |
| 58 | ): |
| 59 | try: |
| 60 | api.send_keepalive(params) |
| 61 | except error.KeeperApiError as kae: |
| 62 | logging.warning(kae.message) |
| 63 | |
| 64 | |
| 65 | TTK = TimeToKeepalive() |