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

Function get_db

db_manager.py:2731–2749  ·  view source on GitHub ↗

Get singleton DatabaseManager instance. Thread-safe lazy initialization. Args: currentdir: Root directory of Ragnar installation Returns: DatabaseManager instance

(currentdir: str = None)

Source from the content-addressed store, hash-verified

2729
2730 # Remove trailing slashes and paths
2731 host = host.split('/')[0]
2732
2733 # Lowercase for consistency
2734 return host.lower().strip()
2735
2736
2737# Singleton instance
2738_db_instance = None
2739_db_lock = threading.Lock()
2740
2741def get_db(currentdir: str = None) -> DatabaseManager:
2742 """
2743 Get singleton DatabaseManager instance.
2744 Thread-safe lazy initialization.
2745
2746 Args:
2747 currentdir: Root directory of Ragnar installation
2748
2749 Returns:
2750 DatabaseManager instance
2751 """
2752 global _db_instance

Callers 15

_init_databaseMethod · 0.90
__init__Method · 0.90
_configure_databaseMethod · 0.90
set_active_networkMethod · 0.90
_seed_counts_from_dbMethod · 0.90
__init__Method · 0.90
sync_all_countsFunction · 0.90
get_stable_network_dataFunction · 0.90
handle_network_requestFunction · 0.90
_collect_manual_targetsFunction · 0.90
start_zap_scanFunction · 0.90
list_zap_credentialsFunction · 0.90

Calls 1

DatabaseManagerClass · 0.85

Tested by

no test coverage detected