diff --git a/ltsdb_json.py b/ltsdb_json.py index faa64af..454f6d3 100644 --- a/ltsdb_json.py +++ b/ltsdb_json.py @@ -9,6 +9,7 @@ import time class LTS: base_dir = "data" + queue_dir = "queue" limit = 1000 def __init__(self, description=None, id=None): @@ -20,6 +21,7 @@ class LTS: m.update(bytes(serialized_description, encoding="UTF-8")) id = m.hexdigest() self.filename = self.base_dir + "/" + id + self.id = id try: with open(self.filename, "r") as fh: fcntl.flock(fh, fcntl.LOCK_SH) @@ -57,6 +59,8 @@ class LTS: fcntl.flock(fh, fcntl.LOCK_EX) json.dump({"description": self.description, "data": self.data}, fh) fh.truncate() + with open(self.queue_dir + "/" + self.id, "w") as fh: + pass def rebuild_index(self): t0 = time.time()