21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-30 07:50:49 +02:00
chexpire/lib/tasks/checks.rake
Jérémy Lecour 815471da76 CheckProcessor configuration is always passed
It's better to redure coupling between these classes and Rails.
It gives liberty to provide configuration and other parameters
depending on the context.
2018-08-29 12:14:34 +02:00

25 lines
717 B
Ruby

# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
namespace :checks do
namespace :sync_dates do
task all: [:domain, :ssl]
desc "Refresh domains expiry dates"
task domain: :environment do
configuration = Rails.configuration.chexpire.fetch("checks_domain")
process = CheckDomainProcessor.new(configuration: configuration)
process.sync_dates
end
desc "Refresh SSL expiry dates"
task ssl: :environment do
configuration = Rails.configuration.chexpire.fetch("checks_ssl")
process = CheckSSLProcessor.new(configuration: configuration)
process.sync_dates
end
end
end