(self)
| 33 | self.running = True |
| 34 | |
| 35 | def run(self): |
| 36 | with config.logging_setup.threadbound(): |
| 37 | try: |
| 38 | esi = Esi.getInstance() |
| 39 | chars = esi.getSsoCharacters() |
| 40 | |
| 41 | for char in chars: |
| 42 | if not self.running: |
| 43 | return |
| 44 | |
| 45 | if char.is_token_expired(): |
| 46 | pyfalog.info(f"Token expired for {char.characterName}, attempting refresh") |
| 47 | try: |
| 48 | esi.refresh(char) |
| 49 | eos.db.save(char) |
| 50 | pyfalog.info(f"Successfully refreshed token for {char.characterName}") |
| 51 | except Exception as e: |
| 52 | pyfalog.error(f"Failed to refresh token for {char.characterName}: {e}") |
| 53 | else: |
| 54 | pyfalog.debug(f"Token valid for {char.characterName}") |
| 55 | |
| 56 | except Exception as e: |
| 57 | pyfalog.error(f"Error validating ESI tokens: {e}") |
| 58 | finally: |
| 59 | if self.callback: |
| 60 | wx.CallAfter(self.callback) |
| 61 | |
| 62 | def stop(self): |
| 63 | self.running = False |
nothing calls this directly
no test coverage detected