ensure db get before query

This commit is contained in:
Justus Kuhlmann 2025-11-21 09:42:40 +01:00
commit 2940ee9055
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
4 changed files with 18 additions and 10 deletions

View file

@ -28,6 +28,7 @@ def write_measurement(path, ensemble, measurement, uuid, code, parameter_file=No
The uuid of the project.
"""
db = os.path.join(path, 'backlogger.db')
dl.get(db, ds=path)
dl.unlock(db, dataset=path)
conn = sqlite3.connect(db)
c = conn.cursor()
@ -176,6 +177,7 @@ def drop_record(path: str, meas_path: str):
file_in_archive = meas_path.split("::")[0]
file = os.path.join(path, file_in_archive)
db = os.path.join(path, 'backlogger.db')
dl.get(db, ds=path)
sub_key = meas_path.split("::")[1]
dl.unlock(db, dataset=path)
conn = sqlite3.connect(db)