Before: we call the function to handle the delimiter task. After: we submit a job to handle the delimiter task.
Signed-off-by: Cao Xueliang caoxl78320@163.com --- src/delimiter.rb | 17 +++++------------ src/delimiter/constants.rb | 2 +- src/delimiter/delimiter.rb | 12 +++--------- 3 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/src/delimiter.rb b/src/delimiter.rb index bb73c5f..bd40775 100644 --- a/src/delimiter.rb +++ b/src/delimiter.rb @@ -2,18 +2,11 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
-require_relative './delimiter/constants' require_relative './delimiter/delimiter'
-START_PROCESS_COUNT.times do - begin - Process.fork do - delimiter = Delimiter.new - delimiter.start_delimit - end - rescue StandardError => e - puts e - end +begin + delimiter = Delimiter.new + delimiter.start_delimit +rescue StandardError => e + puts e end - -sleep() diff --git a/src/delimiter/constants.rb b/src/delimiter/constants.rb index c243df5..ebf90cc 100644 --- a/src/delimiter/constants.rb +++ b/src/delimiter/constants.rb @@ -2,7 +2,7 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. # frozen_string_literal: true
-START_PROCESS_COUNT = 10 +LKP_SRC = ENV['LKP_SRC'] || '/c/lkp-tests' GIT_MIRROR_HOST = ENV['GIT_MIRROR_HOST'] || '172.17.0.1' MONITOR_HOST = ENV['MONITOR_HOST'] || '172.17.0.1' MONITOR_PORT = ENV['MONITOR_PORT'] || '11310' diff --git a/src/delimiter/delimiter.rb b/src/delimiter/delimiter.rb index 67a621d..3dcb3de 100644 --- a/src/delimiter/delimiter.rb +++ b/src/delimiter/delimiter.rb @@ -21,20 +21,14 @@ class Delimiter # consume delimiter task queue task = consume_delimiter_queue unless task - sleep(2) + sleep(60) next end
- # find first bad commit based on the task - git_bisect = GitBisect.new task - result = git_bisect.find_first_bad_commit - - # send mail - mbr = MailBisectResult.new result - mbr.create_send_email + %x(#{LKP_SRC}/sbin/submit job_id=#{task['job_id']} error_id=#{task['error_id']}) rescue StandardError => e puts e - sleep(30) + sleep(60) end end end