Class: CacheKeeper::Configuration
- Inherits:
-
Object
- Object
- CacheKeeper::Configuration
- Defined in:
- lib/cache_keeper/configuration.rb
Constant Summary collapse
- DEFAULT_MUST_REVALIDATE =
false- DEFAULT_QUEUES =
{}
- DEFAULT_CRON_EXPRESSION =
Every 15 minutes, every day
"*/15 * * * *"
Instance Method Summary collapse
Instance Method Details
#cron_adapter ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cache_keeper/configuration.rb', line 17 def cron_adapter return if rails_config.cron.adapter.nil? case rails_config.cron.adapter when :good_job CacheKeeper::Cron::GoodJobAdapter else raise "Unknown cron adapter: #{rails_config.cron.adapter}" end end |
#cron_expression ⇒ Object
28 29 30 |
# File 'lib/cache_keeper/configuration.rb', line 28 def cron_expression rails_config.cron.expression || DEFAULT_CRON_EXPRESSION end |
#must_revalidate ⇒ Object
7 8 9 10 11 |
# File 'lib/cache_keeper/configuration.rb', line 7 def must_revalidate return rails_config.must_revalidate unless rails_config.must_revalidate.nil? DEFAULT_MUST_REVALIDATE end |
#queues ⇒ Object
13 14 15 |
# File 'lib/cache_keeper/configuration.rb', line 13 def queues rails_config.queues || DEFAULT_QUEUES end |