Skip to content
Snippets Groups Projects
Commit 1b0b2d92 authored by 张超魁's avatar 张超魁
Browse files

finish

parent c3485829
Branches main
No related tags found
No related merge requests found
......@@ -92,10 +92,12 @@ def execute(workspace_name):
logging.info("execute workspace [%s]." % workspace_name)
job = request.json
job["name"] = workspace_name
q.put(json.dumps(job))
if job["emergency"] is True:
q.put_emergency(json.dumps(job))
else:
q.put(json.dumps(job))
return jsonify(json_message(SUCCESS, "success"))
......
......@@ -24,6 +24,9 @@ class RedisQueue:
def put(self, obj):
self.__db.rpush(self.queue_name, obj)
def put_emergency(self, obj):
self.__db.lpush(self.queue_name, obj)
def get(self, timeout=0, blocked=True):
if blocked is True:
return self.__db.blpop(self.queue_name, timeout=timeout)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment