Module: Job::Cleanup

Extended by:
ActiveSupport::Concern
Included in:
Job
Defined in:
lib/travis/model/job/cleanup.rb

Constant Summary collapse

FORCE_FINISH_MESSAGE =
<<-msg.strip
  This job could not be processed and was forcefully finished.
msg

Instance Method Summary collapse

Instance Method Details

#enqueueObject



29
30
31
32
# File 'lib/travis/model/job/cleanup.rb', line 29

def enqueue
  Travis::Notifications::Worker.enqueue(self)
  update_attribute(:retries, retries + 1)
end

#force_finishObject



34
35
36
37
# File 'lib/travis/model/job/cleanup.rb', line 34

def force_finish
  append_log!("\n#{FORCE_FINISH_MESSAGE}") if respond_to?(:append_log!)
  finish!(:status => 1, :finished_at => Time.now)
end

#requeueable?Boolean

Returns:

  • (Boolean)


39
40
41
42
# File 'lib/travis/model/job/cleanup.rb', line 39

def requeueable?
  false
  # retries < Travis.config.jobs.retry.max_attempts
end