end
# get availables server
- # but, job must not be "REGISTER" and "MULTIBUILD" job
- if job.type != "REGISTER" and job.type != "MULTIBUILD" then
+ if job.type == "MULTIBUILD" or job.type == "REGISTER" then
+ # if max working job is zero, check max-non-build-jobs
+ if @jobmgr.max_working_jobs == 0 and local_empty_rooms >= -4 then
+ candidates.push self
+ end
+ else
+ # if normal JOB
@remote_servers.each do |server|
if ( server.status == "RUNNING" and server.can_build?( job ) and
not server.has_waiting_jobs and
end
end
- best_server = candidates[0]
- if best_server.nil? or candidates.count == 1 then return best_server end
+ if candidates.count == 0 then return nil end
# get best
# it is better if working jobs count is less
+ best_server = candidates[0]
max_empty_room = best_server.get_number_of_empty_room
candidates.each do |server|
# check whether idle, use it
#PRE-EXEC
-../../build-svr set-attr -n testserver3 -A MAX_WORKING_JOBS -V 1
#EXEC
../../build-cli build -N testa,testb -d 127.0.0.1:2223 -o ubuntu-32 -D unstable --rebuild
#POST-EXEC
-../../build-svr set-attr -n testserver3 -A MAX_WORKING_JOBS -V 0
#EXPECT
Info: Added new job
Info: Initializing job...