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
@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 }