problem:
stats_worker call add_task() of TaskQueueAPI to send delimiter task,
but no task added in delimiter task queue.
cause analysis:
the latest TaskQueueAPI.add_task(service_queue_path, task),
require {"lab" => $LAB} in task content, otherwise return error message:
"409, need lab in task content"
in fact, we miss "lab", so can not send task to task queue.
Signed-off-by: Lu Weitao <luweitaobe(a)163.com>
---
src/extract-stats/stats_worker.cr | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/extract-stats/stats_worker.cr b/src/extract-stats/stats_worker.cr
index 3cff51d..fcba6af 100644
--- a/src/extract-stats/stats_worker.cr
+++ b/src/extract-stats/stats_worker.cr
@@ -76,7 +76,8 @@ class StatsWorker
unless new_error_ids.empty?
STDOUT.puts "send a delimiter task: job_id is #{job_id}"
@tq.add_task(DELIMITER_TASK_QUEUE, JSON.parse({"error_id" => new_error_ids.sample,
- "job_id" => job_id}.to_json))
+ "job_id" => job_id,
+ "lab" => LAB}.to_json))
end
msg = %({"job_id": "#{job_id}", "job_state": "extract_finished"})
system "echo '#{msg}'"
--
2.23.0