From: donghee yang Date: Wed, 12 Dec 2012 14:22:39 +0000 (+0900) Subject: [Title] Fixed a bug that remote server status reset to "DISCONNECTED" X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33a0aafa9ef7d7ff2287428bfc3c4ec804a81967;p=sdk%2Ftools%2Fsdk-build.git [Title] Fixed a bug that remote server status reset to "DISCONNECTED" --- diff --git a/src/build_server/RemoteBuildServer.rb b/src/build_server/RemoteBuildServer.rb index 6e86a09..c395d82 100644 --- a/src/build_server/RemoteBuildServer.rb +++ b/src/build_server/RemoteBuildServer.rb @@ -73,9 +73,10 @@ class RemoteBuildServer def update_state(db) # send - @status = "DISCONNECTED" + #@status = "DISCONNECTED" client = BuildCommClient.create( @ip, @port ) if client.nil? then + @status = "DISCONNECTED" db.do "UPDATE remote_build_servers SET status = 'DISCONNECTED', max_job_count = 0, working_job_count = 0, waiting_job_count = 0 WHERE id = #{@id}" return end @@ -100,7 +101,11 @@ class RemoteBuildServer @working_jobs = [] @waiting_jobs = [] client = BuildCommClient.create( @ip, @port ) - if client.nil? then return end + if client.nil? then + @status = "DISCONNECTED" + db.do "UPDATE remote_build_servers SET status = 'DISCONNECTED', max_job_count = 0, working_job_count = 0, waiting_job_count = 0 WHERE id = #{@id}" + return + end if client.send("QUERY|JOB") then result = client.read_lines do |l| tok = l.split(",").map { |x| x.strip }