From: dibs Date: Wed, 27 Mar 2013 14:59:40 +0000 (+0900) Subject: [title] removed about NewLog class, Job.status. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d55c9b82857b8cff73a2f177743e60933eb6f33f;p=sdk%2Ftools%2Fsdk-build.git [title] removed about NewLog class, Job.status. --- diff --git a/build-cli b/build-cli index 14bc404..0289834 100755 --- a/build-cli +++ b/build-cli @@ -217,9 +217,7 @@ begin client.terminate rescue => e puts "ERROR: #{e}" - if not client.terminated? then - client.terminate - end + client.terminate exit 1 end @@ -256,9 +254,7 @@ begin rescue => e puts "ERROR: #{e}" result = false - if not client.terminated? then - client.terminate - end + client.terminate end end diff --git a/src/build_server/BuildServer.rb b/src/build_server/BuildServer.rb index 202d97f..61b3059 100644 --- a/src/build_server/BuildServer.rb +++ b/src/build_server/BuildServer.rb @@ -787,6 +787,7 @@ class BuildServer @log.info "Sending job log : #{job_number}" job = nil + job_status = "" (@jobmgr.jobs + @jobmgr.internal_jobs + @jobmgr.reverse_build_jobs).each do |manager_job| if manager_job.id.eql? job_number then job = manager_job @@ -805,6 +806,12 @@ class BuildServer if line.strip.empty? then next end BuildCommServer.send(conn, line) + # Send status when changed status + if (not job.nil?) and (not job.status.eql?(job_status)) then + job_status = job.status + BuildCommServer.send(conn, "=JOB_STATUS,#{job_status}") + end + # if read file's last line and job status ended then log file sending done if log.eof? and (job.nil? or job.status.eql? "FINISHED" or @@ -812,7 +819,6 @@ class BuildServer job.status.eql? "CANCELED") then # Log file send done. & send job status - job_status = "" get_db_connection() do |db| job_status = db.select_one("SELECT status FROM jobs WHERE id = #{job_number}")[0] end diff --git a/src/build_server/CommonJob.rb b/src/build_server/CommonJob.rb index 23e3fa4..a352271 100644 --- a/src/build_server/CommonJob.rb +++ b/src/build_server/CommonJob.rb @@ -64,19 +64,6 @@ class CommonJob @sub_pid = 0 end - # processing in updated status (set stauts) - def status=(value) - @status = value - if not @log.nil? then - @log.job_status(@status, "") - @log.logger.flush - end - end - - def status - return @status - end - # event check def check_event # CANCEL/CANCELING diff --git a/src/common/BuildComm.rb b/src/common/BuildComm.rb index 7e95dee..5221635 100644 --- a/src/common/BuildComm.rb +++ b/src/common/BuildComm.rb @@ -373,10 +373,6 @@ class BuildCommClient return new(socket, log) end - def terminated? - return @socket.closed? - end - def get_error_msg() return @error_msg end diff --git a/src/common/log.rb b/src/common/log.rb index facd41c..2933ac8 100644 --- a/src/common/log.rb +++ b/src/common/log.rb @@ -28,12 +28,6 @@ Contributors: require "logger" -class NewLogger < Logger - def flush - @logdev.dev.flush - end -end - class Log attr_accessor :path, :cnt, :logger @@ -48,9 +42,9 @@ class Log @cnt = 0 @path = path if @path.nil? then - @logger = NewLogger.new(STDOUT) + @logger = Logger.new(STDOUT) else - @logger = NewLogger.new(path, "monthly") + @logger = Logger.new(path, "monthly") end # if log level is bigger/equal to second out level # , we will send the log to second-out