File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,13 @@ async def get_monitor(db_path: Optional[str] = None) -> AccessMonitor:
1717 Get a configured access monitor instance
1818
1919 Args:
20- db_path: Optional custom path to the database file. Defaults to ~/.mcpm/monitor.duckdb
20+ db_path: Optional custom path to the database file. If None, uses the default
21+ config directory from ConfigManager.
2122
2223 Returns:
2324 Configured AccessMonitor instance
2425 """
25- monitor = DuckDBAccessMonitor (db_path ) if db_path else DuckDBAccessMonitor ()
26+ monitor = DuckDBAccessMonitor (db_path )
2627 await monitor .initialize_storage ()
2728 return monitor
2829
Original file line number Diff line number Diff line change 1111import duckdb
1212
1313from mcpm .monitor .base import AccessEventType , AccessMonitor
14+ from mcpm .utils .config import ConfigManager
1415
1516
1617class DuckDBAccessMonitor (AccessMonitor ):
@@ -19,13 +20,18 @@ class DuckDBAccessMonitor(AccessMonitor):
1920 This uses a thread pool to execute DuckDB operations asynchronously.
2021 """
2122
22- def __init__ (self , db_path : str = "~/.mcpm/monitor.duckdb" ):
23+ def __init__ (self , db_path : Optional [ str ] = None ):
2324 """
2425 Initialize the DuckDBAccessMonitor.
2526
2627 Args:
27- db_path: Path to the DuckDB database file
28+ db_path: Path to the DuckDB database file. If None, uses the default config directory.
2829 """
30+ if db_path is None :
31+ # Use ConfigManager to get the base config directory
32+ config_manager = ConfigManager ()
33+ db_path = os .path .join (config_manager .config_dir , "monitor.duckdb" )
34+
2935 self .db_path = os .path .expanduser (db_path )
3036 self .connection = None
3137 self ._initialized = False
You can’t perform that action at this time.
0 commit comments