-
Notifications
You must be signed in to change notification settings - Fork 6
/
cloudwatch_schedule.rb
36 lines (31 loc) · 1.06 KB
/
cloudwatch_schedule.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require "cloudwatch_scheduler"
CloudwatchScheduler() do |_config|
# every hour at 10 minutes past the hour
task "run_notifications", cron: "10 * * * ? *" do
RunNotificationsService.new.call!
end
# every day at 5:00am
task "cleanup", cron: "0 5 * * ? *" do
CleanupDbService.new.call!
end
task "autoscale", cron: "0/15 * * * ? *" do
AutoscaleServersService.new.call!
end
task "drop_expired_signups", cron: "0/10 * * * ? *" do
DropExpiredSignupsJob.perform_later
end
if ENV["HEROKU_API_TOKEN"].present? && ENV["HEROKU_APP_NAME"].present?
task "refresh_certs", cron: "30 5 * * ? *" do
RefreshSslCertificateService.new(
heroku_api_token: ENV["HEROKU_API_TOKEN"],
heroku_app_name: ENV["HEROKU_APP_NAME"],
root_domain: ENV["INTERCODE_HOST"],
**{
no_wildcard_domains: ENV["INTERCODE_CERTS_NO_WILDCARD_DOMAINS"]&.split(" "),
skip_domains: ENV["INTERCODE_CERTS_SKIP_DOMAINS"]&.split(" "),
staging: ENV["INTERCODE_CERTS_STAGING"]
}.compact
).call!
end
end
end