summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--storperf/db/job_db.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/storperf/db/job_db.py b/storperf/db/job_db.py
index f24ccf4..57c82cb 100644
--- a/storperf/db/job_db.py
+++ b/storperf/db/job_db.py
@@ -80,9 +80,11 @@ class JobDB(object):
"""
Records the start time for the given workload
"""
+
+ if (self.job_id is None):
+ self.create_job_id()
+
with db_mutex:
- if (self.job_id is None):
- self.create_job_id()
db = sqlite3.connect(JobDB.db_name)
cursor = db.cursor()
@@ -124,9 +126,10 @@ class JobDB(object):
"""
Records the end time for the given workload
"""
+ if (self.job_id is None):
+ self.create_job_id()
+
with db_mutex:
- if (self.job_id is None):
- self.create_job_id()
db = sqlite3.connect(JobDB.db_name)
cursor = db.cursor()