From 99bc4fc20568512f98706356bc5c1957b59fd5b3 Mon Sep 17 00:00:00 2001 From: Dmitrii Andreev Date: Sun, 17 Mar 2024 15:26:09 +0300 Subject: [PATCH] maked cache persist --- src/cache.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cache.py b/src/cache.py index be992c9..8323590 100644 --- a/src/cache.py +++ b/src/cache.py @@ -1,13 +1,16 @@ """cache""" import sqlite3 +from config import load_configuration -def db_init(db_path='/tmp/recorded_file_hashes.db'): +def db_init(db_name='recorded_file_hashes.db'): """ Connect to the database and return the connection object. """ - conn = sqlite3.connect(db_path) + config = load_configuration() + + conn = sqlite3.connect(config.output_directory + db_name) conn.execute("CREATE TABLE IF NOT EXISTS file_hashes (file_path TEXT PRIMARY KEY, file_hash TEXT)") return conn