MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / shutdown_encrypt

Method shutdown_encrypt

auth_manager.py:811–826  ·  view source on GitHub ↗

Called on application shutdown to encrypt the database.

(self)

Source from the content-addressed store, hash-verified

809 raise
810
811 def shutdown_encrypt(self):
812 """Called on application shutdown to encrypt the database."""
813 if not self.is_configured():
814 return
815 if not self._fernet_key:
816 logger.warning("No Fernet key at shutdown - DB may not be encrypted")
817 return
818
819 try:
820 self._close_db()
821 time.sleep(0.2)
822 if os.path.exists(self.main_db_path):
823 self.encrypt_database()
824 logger.info("Database encrypted on shutdown")
825 except Exception as e:
826 logger.error(f"Shutdown encryption failed: {e}")
827
828 # =========================================================================
829 # CRASH RECOVERY

Callers 2

handle_exitFunction · 0.80
_atexit_encryptFunction · 0.80

Calls 7

is_configuredMethod · 0.95
_close_dbMethod · 0.95
encrypt_databaseMethod · 0.95
warningMethod · 0.80
infoMethod · 0.80
errorMethod · 0.80
sleepMethod · 0.45

Tested by

no test coverage detected