From 211e0b6bdf3db7f751bd13d0f18fd8d2ad4cd7ae Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Wed, 17 Nov 2010 09:07:27 -0800 Subject: [PATCH] [#4722] Store cache lockfile in RAILS_ROOT/tmp --- app/models/rate.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/rate.rb b/app/models/rate.rb index 16fa7a3..a6d4303 100644 --- a/app/models/rate.rb +++ b/app/models/rate.rb @@ -145,7 +145,7 @@ class Rate < ActiveRecord::Base options = {:retries => 0, :suspend => 1} options[:max_age] = 1 if force - Lockfile(CACHING_LOCK_FILE_NAME, options) do + Lockfile(lock_file, options) do block.call end end @@ -154,4 +154,8 @@ class Rate < ActiveRecord::Base public generator_for :date_in_effect => Date.today end + + def self.lock_file + Rails.root + 'tmp' + Rate::CACHING_LOCK_FILE_NAME + end end