From f6fb8fc46aea76e9c4011a091b9a86306b72d42d Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 10 Mar 2021 15:16:52 +0300 Subject: Use the correct id to fetch cmd status --- sheepdog/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sheepdog') diff --git a/sheepdog/worker.py b/sheepdog/worker.py index 6299ca7..4e3610e 100644 --- a/sheepdog/worker.py +++ b/sheepdog/worker.py @@ -16,7 +16,7 @@ def run_jobs(conn): cmd_id = (conn.lpop("GN3::job-queue") or b'').decode("utf-8") if bool(cmd_id): cmd = conn.hget(name=cmd_id, key="cmd") - if cmd and (conn.hget(cmd, "status") == b"queued"): + if cmd and (conn.hget(cmd_id, "status") == b"queued"): result = run_cmd(cmd.decode("utf-8")) conn.hset(name=cmd_id, key="result", value=result.get("output")) if result.get("code") == 0: # Success -- cgit v1.2.3