[#4722] Store cache lockfile in RAILS_ROOT/tmp
This commit is contained in:
1 parent
920c8cdda5
commit
211e0b6bdf
1 file changed
+5
-1
+5
-1
@@ -145,7 +145,7 @@ class Rate < ActiveRecord::Base
|
|||||||
options = {:retries => 0, :suspend => 1}
|
options = {:retries => 0, :suspend => 1}
|
||||||
options[:max_age] = 1 if force
|
options[:max_age] = 1 if force
|
||||||
|
|
||||||
Lockfile(CACHING_LOCK_FILE_NAME, options) do
|
Lockfile(lock_file, options) do
|
||||||
block.call
|
block.call
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -154,4 +154,8 @@ class Rate < ActiveRecord::Base
|
|||||||
public
|
public
|
||||||
generator_for :date_in_effect => Date.today
|
generator_for :date_in_effect => Date.today
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.lock_file
|
||||||
|
Rails.root + 'tmp' + Rate::CACHING_LOCK_FILE_NAME
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user