Failsafe Adapter
Wraps another adapter and fails safely when an exception is raised. This prevents issues like network hiccups from taking down an application using Flipper.
Installation
This adapter is included with the flipper
gem.
Usage
Flipper.configure do |config|
config.use Flipper::Adapters::Failsafe,
errors: [Redis::ConnectionError, Redis::TimeoutError]
config.adapter do
Flipper::Adapters::Redis.new(Redis.new)
end
end
The errors
option defaults to [StandardError]
, which will rescue any exception raised. It is recommended to set it to specific errors that you anticipate could take down your application.
Warning: This adapter will silently swallow the errors that it encounters, including those encountered while updating features (like Flipper.enable :my_feature
). You will likely want some other health check in place to notify you of issues.
Get audit history, rollbacks, advanced permissions, analytics, and all of your projects in one place.
You can choose from several tiers to sponsor Flipper on GitHub and get some great benefits!