##A plugin to check cache connection with heartcheck.
Add this line to your application's Gemfile:
gem 'heartcheck-cache'
And then execute:
$ bundle
Or install it yourself as:
$ gem install heartcheck-cache
You can check any cache connection that there's in your app.
Each service need to respond to :name
(an indetifier) and :connection
(an activerecord connection)
Heartcheck.setup do |config|
config.add :cache do |c|
c.add_service(name: 'MyCacheConnection', connection: Dalli::Client.new('localhost:11211'))
end
end
If you need check the Rails.cache
this service need be added with dynamic service;
The dynamic service is a Hash that needs to respond to :name
to identify the service and :connection
that is recommended to use the cache connection that your app is using.
Ex.
Heartcheck.setup do |config|
config.add :cache do |c|
c.add_service(name: 'MyRailsCacheConnection', connection: Rails.cache.instance_variable_get("@data"))
end
end
Check Heartcheck example here
- Fork it ( https://github.com/locaweb/heartcheck-cache )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request