app/models/naf/running_job.rb in naf-2.1.10 vs app/models/naf/running_job.rb in naf-2.1.11
- old
+ new
@@ -1,7 +1,9 @@
module Naf
class RunningJob < NafBase
+ include PgAdvisoryLocker
+
# Protect from mass-assignment issue
attr_accessible :application_id,
:application_schedule_id,
:application_type_id,
:command,
@@ -115,8 +117,15 @@
def remove_all_tags
self.tags = '{}'
self.save!
end
+ def lock_for_runner_use(&block)
+ advisory_lock(&block)
+ end
+
+ def unlock_for_runner_use
+ advisory_unlock
+ end
end
end