Decrypt DB and reinitialize in a background thread.
(self)
| 481 | return {'success': False, 'error': f'Login failed: {str(e)}'} |
| 482 | |
| 483 | def _background_decrypt(self): |
| 484 | """Decrypt DB and reinitialize in a background thread.""" |
| 485 | try: |
| 486 | logger.info("Background DB decryption starting...") |
| 487 | self._close_db() |
| 488 | time.sleep(0.2) |
| 489 | self.decrypt_database() |
| 490 | self._reinit_db() |
| 491 | self._db_ready = True |
| 492 | logger.info("Background DB decryption complete - DB ready") |
| 493 | except Exception as e: |
| 494 | logger.error(f"Background decrypt failed: {e}") |
| 495 | self._db_ready = True # Mark ready anyway so the system isn't stuck |
| 496 | |
| 497 | def logout(self) -> dict: |
| 498 | """Encrypt database and clear session data.""" |
nothing calls this directly
no test coverage detected