parse_serial_logs.cr:46:5 [W] Lint/UselessAssign: Useless assignment to variable `host`
host = File.basename(msg["serial_path"].to_s)
^ parse_serial_logs.cr:95:5 [W] Lint/UselessAssign: Useless assignment to variable `job_id`
job_id = matched.named_captures["job_id"]
^ parse_serial_logs.cr:101:5 [W] Lint/UselessAssign: Useless assignment to variable `job`
job = Elasticsearch::Client.new.get_job_content(job_id)
^ Finished in 10.93 milliseconds
1 inspected, 3 failures.
Signed-off-by: Wu Zhende wuzhende666@163.com --- src/monitoring/parse_serial_logs.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/monitoring/parse_serial_logs.cr b/src/monitoring/parse_serial_logs.cr index a000ca3..6c8a220 100644 --- a/src/monitoring/parse_serial_logs.cr +++ b/src/monitoring/parse_serial_logs.cr @@ -43,7 +43,7 @@ class SerialParser def host_in_msg(msg) return unless msg["serial_path"]?
- host = File.basename(msg["serial_path"].to_s) + File.basename(msg["serial_path"].to_s) end
def detect_start_or_end(msg, host, pattern_list) @@ -92,13 +92,13 @@ class SerialParser matched = msg["message"].to_s.match(/.*/job_initrd_tmpfs/(?<job_id>.*?)//) return unless matched
- job_id = matched.named_captures["job_id"] + matched.named_captures["job_id"] end
def find_job(job_id) return unless job_id
- job = Elasticsearch::Client.new.get_job_content(job_id) + Elasticsearch::Client.new.get_job_content(job_id) end
def dump_cache(job, msg, host)