-
Notifications
You must be signed in to change notification settings - Fork 5
/
clock.rb
77 lines (59 loc) · 1.71 KB
/
clock.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
require 'clockwork'
require 'sidekiq/api'
require File.expand_path('config/environment', File.dirname(__FILE__))
include Clockwork
if Rails.env.production? || Rails.env.staging?
every(2.minutes, 'live_cloud_resources') do
LiveCloudResourcesJob.perform_later
end
every(4.hours, 'usage_sync') do
UsageJob.perform_later
end
every(20.minutes, 'activation_reminder') do
ActivationReminderJob.perform_later
end
every(1.day, 'reaper', :at => '02:00') do
ReaperJob.perform_later
end
every(5.minutes, 'status_io_cache_warm') do
StatusIOCacheWarmJob.perform_later
end
every(1.hour, 'load_soulmate') do
SearchTermJob.perform_later
end
every(1.week, 'usage_report', :at => 'Monday 03:00') do
UsageReportJob.perform_later
end
every(1.week, 'salesforce_sync', :at => 'Monday 08:00') do
SalesforceSyncAllJob.perform_later
end
every(1.day, 'usage_sanity_am', :at => '06:00') do
UsageSanityJob.perform_later
end
every(1.day, 'usage_sanity_pm', :at => '14:00') do
UsageSanityJob.perform_later
end
every(1.day, 'clear_stale_signups', :at => '01:00') do
ClearStaleSignupsJob.perform_later
end
every(5.hours, 'restart_sidekiq') do
RestartQueueJob.perform_later
end
every(4.hours, 'restart_sidekiq_slow') do
RestartSlowQueueJob.perform_later
end
every(1.day, 'billing_run', :at => '06:30') do
BillingRunJob.perform_later if Time.now.day == 1
end
every(1.day, 'audit_blanks', :at => '01:00') do
FillAuditBlanksJob.perform_later
end
every(1.day, 'organization_usage_near_threshold_alert', :at => '15:00') do
UsageAlertJob.perform_later
end
end
module Clockwork
error_handler do |error|
Honeybadger.notify(error)
end
end