Compare commits

...

2 Commits

1 changed files with 21 additions and 17 deletions

View File

@ -25,7 +25,11 @@ class EduSetting < ApplicationRecord
end end
def self.get(key) def self.get(key)
Rails.cache.fetch(value_cache_key(key), expires_in: 1.days) do begin
Rails.cache.fetch(value_cache_key(key), expires_in: 1.days) do
find_by_name(key.to_s)&.value
end
rescue Exception => e
find_by_name(key.to_s)&.value find_by_name(key.to_s)&.value
end end
end end