app/models/process/naf/application.rb in naf-1.1.4 vs app/models/process/naf/application.rb in naf-2.0.0
- old
+ new
@@ -5,11 +5,11 @@
class TerminationRequest < StandardError
attr_reader :job, :reason
def initialize(job, reason)
@job = job
@reason = reason
- super("Requested to terminate: #{reason}")
+ super("Requested to terminate by Naf: #{reason}")
end
end
#----------------
# *** Options ***
@@ -91,11 +91,11 @@
end
end
end
def job_tag_block(*tags, &block)
- job = fetch_naf_job
+ job = fetch_naf_job.try(:running_job)
begin
if job
add_job_tags(*tags)
end
yield if block.present?
@@ -105,10 +105,10 @@
end
end
end
def update_job_tags(old_tags, new_tags)
- job = fetch_naf_job
+ job = fetch_naf_job.try(:running_job)
if job
job.remove_tags(old_tags.map(&:to_s))
job.add_tags(new_tags.map(&:to_s))
end
end