Module: JobIteration::Iteration::PrependedClassMethods

Defined in:
lib/job-iteration/iteration.rb

Instance Method Summary collapse

Instance Method Details

#job_iteration_max_job_runtime=(new) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/job-iteration/iteration.rb', line 59

def job_iteration_max_job_runtime=(new)
  existing = job_iteration_max_job_runtime

  if existing && (!new || new > existing)
    existing_label = existing.inspect
    new_label = new ? new.inspect : "#{new.inspect} (no limit)"
    raise(
      ArgumentError,
      "job_iteration_max_job_runtime may only decrease; " \
        "#{self} tried to increase it from #{existing_label} to #{new_label}",
    )
  end

  super
end