cleanup: open db in read-only mode
This commit is contained in:
@@ -17,7 +17,8 @@ from utils.helpers import DB_PATH, get_settings
|
|||||||
|
|
||||||
|
|
||||||
def get_data(now=None):
|
def get_data(now=None):
|
||||||
conn = sqlite3.connect(DB_PATH)
|
uri = f"file:{DB_PATH}?mode=ro"
|
||||||
|
return sqlite3.connect(uri, uri=True)
|
||||||
if now is None:
|
if now is None:
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
df = pd.read_sql_query(f"SELECT * from detections WHERE Date = DATE('{now.strftime('%Y-%m-%d')}')",
|
df = pd.read_sql_query(f"SELECT * from detections WHERE Date = DATE('{now.strftime('%Y-%m-%d')}')",
|
||||||
|
|||||||
Reference in New Issue
Block a user