Skip to content

Commit 3ca7990

Browse files
committed
log error database already exists
1 parent 1b14374 commit 3ca7990

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/seclab_taskflows/mcp_servers/gh_file_viewer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def __repr__(self):
5353
SEARCH_RESULT_DIR = mcp_data_dir("seclab-taskflows", "gh_file_viewer", "SEARCH_RESULTS_DIR")
5454

5555
engine = create_engine(f"sqlite:///{os.path.abspath(SEARCH_RESULT_DIR)}/search_result.db", echo=False)
56-
Base.metadata.create_all(engine, tables=[SearchResults.__table__])
56+
57+
try:
58+
Base.metadata.create_all(engine, tables=[SearchResults.__table__])
59+
except Exception as e:
60+
logging.error(f"Database already exists: {e}") # only log here, as this error likely only happens in test
5761

5862

5963
async def call_api(url: str, params: dict) -> str:

0 commit comments

Comments
 (0)