Reinitialize the database connection after decryption.
(self)
| 893 | logger.error(f"Failed to close DB: {e}") |
| 894 | |
| 895 | def _reinit_db(self): |
| 896 | """Reinitialize the database connection after decryption.""" |
| 897 | try: |
| 898 | from db_manager import reinit_db |
| 899 | self.shared_data.db = reinit_db(currentdir=getattr(self.shared_data, 'currentdir', None)) |
| 900 | # Re-apply network storage context if it was set during startup |
| 901 | if hasattr(self.shared_data, '_configure_database'): |
| 902 | self.shared_data._configure_database() |
| 903 | except Exception as e: |
| 904 | logger.error(f"Failed to reinitialize DB: {e}") |
| 905 | |
| 906 | def is_db_available(self) -> bool: |
| 907 | """Check if the main database is available (decrypted).""" |
no test coverage detected