zendesk / arturo

Feature Sliders for Rails
http://github.com/zendesk/arturo
Other
206 stars 24 forks source link

Extend cache on database failure #109

Closed angelim closed 4 years ago

angelim commented 4 years ago

Allows consumers to reuse(and extend) an old cache when the database is not available for a refresh. If the cache is not yet bootstrapped we still raise the exception.

This feature is opt-in and managed by Arturo::Feature.extend_cache_on_failure config.

Logging(optional) was added to help debug cache extension events. You'll be able to see one of:

Side note:

Also had to lock sqlite3 on older rails gemfiles to make travis happy.

# Gem::LoadError:
#   can't activate sqlite3 (~> 1.3.5), already activated sqlite3-1.4.2. Make sure all dependencies are added to Gemfile.
#   ./spec/support/prepare_database.rb:4:in `<top (required)>'
angelim commented 4 years ago

@craig-day need another review. Had to introduce logging here.