1
0
Fork 0
mirror of https://github.com/ThomasGsp/HyperProxmox.git synced 2025-02-15 04:32:15 +00:00

Insert lock system for mod analyst

This commit is contained in:
Tlams 2018-02-08 16:21:58 +00:00
parent c335afc350
commit 049ceee99f

View file

@ -58,9 +58,14 @@ class Core:
""" RUN THE ANALYZER IN DEDICATED THEARD""" """ RUN THE ANALYZER IN DEDICATED THEARD"""
self.clusters_conf = self.mongo.get_clusters_conf()["value"] self.clusters_conf = self.mongo.get_clusters_conf()["value"]
""" Clean previous lockers """
locker = Locker()
locker.unlock(generalconf["hyperproxmox"]["walker_lock"])
thc = threading.Thread(name="Update statistics", thc = threading.Thread(name="Update statistics",
target=RunAnalyse, target=RunAnalyse,
args=(self.clusters_conf, self.generalconf)) args=(self.clusters_conf, self.generalconf,
generalconf["hyperproxmox"]["walker"]))
thc.start() thc.start()
@ -100,7 +105,7 @@ class Core:
else: else:
resultmbrequest = json_decode({"value": "Bad request"}) resultmbrequest = json_decode({"value": "Bad request"})
self.redis_cache.insert_message(hash_hex, resultmbrequest) self.redis_cache.insert_message(hash_hex, resultmbrequest, 3600)
return resultmbrequest return resultmbrequest
else: else:
return cache return cache