mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Story #105846070 - show error message to user when service not available
This commit is contained in:
parent
c926aa4100
commit
352c748258
3 changed files with 8 additions and 3 deletions
|
@ -48,7 +48,7 @@ class BusinessRegistryCache < ActiveRecord::Base
|
|||
cache = BusinessRegistryCache.find_by(ident: ident_code, ident_country_code: ident_cc)
|
||||
# fetch new data if cache is expired
|
||||
return cache if cache.present? && cache.retrieved_on > (Time.zone.now - Setting.days_to_keep_business_registry_cache.days)
|
||||
cache = nil # expired data is forbidden
|
||||
cache = [] # expired data is forbidden
|
||||
data = business_registry.associated_businesses(ident_code, ident_cc)
|
||||
unless data.nil?
|
||||
cache = BusinessRegistryCache.new(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue