lib/ripe/worker_controller/syncer.rb
##
# Update the status of completed workers from the running jobs.
#
# @return [void]
Update the status of completed workers from the running jobs.
Update the status of completed workers from the running jobs .
def update_completed_workers
        @workers += @completed_workers.map do |worker|
          stdout = (File.exists?(worker.stdout)) ? File.new(worker.stdout).readlines.join : ""
          worker.update({
            cpu_used:    stdout[/Resources:[ \t]*cput=([0-9]{1,2}(\:[0-9]{2})+),/, 1],
            exit_code:   stdout[/Exit code:[ \t]*(.*)$/, 1],
            host:        stdout[/Nodes:[ \t]*(.*)$/, 1],
            memory_used: stdout[/Resources:.*,mem=([0-9]*[a-zA-Z]*),/, 1],
            time:        stdout[/Resources:.*,walltime=([0-9]{1,2}(\:[0-9]{2})+)$/, 1],
            status:      :completed,
          })
          worker
        end
      end
def update_completed_workers @workers += @completed_workers . map do | worker | stdout = ( File . exists? ( worker . stdout ) ) ? File . new ( worker . stdout ) . readlines . join : "" worker . update ( { cpu_used : stdout [ / Resources:[  \t ]*cput=([0-9]{1,2}( \: [0-9]{2})+), / , 1 ] , exit_code : stdout [ / Exit code:[  \t ]*(.*)$ / , 1 ] , host : stdout [ / Nodes:[  \t ]*(.*)$ / , 1 ] , memory_used : stdout [ / Resources:.*,mem=([0-9]*[a-zA-Z]*), / , 1 ] , time : stdout [ / Resources:.*,walltime=([0-9]{1,2}( \: [0-9]{2})+)$ / , 1 ] , status : :completed , } ) worker end end
Update the status of completed workers from the running jobs.
Update the status of completed workers from the running jobs .
None
void