-
Notifications
You must be signed in to change notification settings - Fork 19
/
schedule.rb
79 lines (62 loc) · 1.79 KB
/
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
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
78
79
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# rbenv support
rbenv = 'export PATH="$HOME/.rbenv/bin:$PATH";eval "$(rbenv init -)";'
path = Whenever.path.sub(%r{\/releases\/.*}, '/current')
set :job_template, "/bin/bash -l -c '#{rbenv} :job'"
job_type :runner, "cd #{path} && bin/rails r -e :environment \":task\" :output"
# cron output
set :output, 'log/cron.log'
if @cron_group == 'registry'
every 10.minutes do
runner 'DNS::Zone.generate_zonefiles'
end
every :day, at: '12:01am' do
rake 'contacts:archive'
end
every :day, at: '12:10am' do
rake 'invoices:cancel_overdue'
end
# TODO
# every :day, at: '12:15am' do
# runner 'Domain.expire_domains'
# end
every :day, at: '12:20am' do
runner 'DomainCron.clean_expired_pendings'
end
every 3.hours do
runner 'Certificate.update_crl'
end
every 45.minutes do
runner 'DomainCron.start_expire_period'
end
every 52.minutes do
runner 'DomainCron.start_redemption_grace_period'
end
every 1.day do
runner 'DomainCron.start_client_hold'
end
every '0 0 1 * *' do
runner 'Directo.send_monthly_invoices'
end
every :day, at: '19:00pm' do
runner 'Directo.send_receipts'
end if @environment == 'production'
every 42.minutes do
rake 'domain:discard'
end
every 10.minutes do
rake 'verify_email:all_domains'
end
# Should be at least once every 4 days, since according to LHV specs:
# "Unread messages older than 5 days are automatically scheduled for deletion"
# https://partners.lhv.ee/en/connect/#messaging
every :day, at: '12:01am' do
rake 'invoices:process_payments'
end
end
every 10.minutes do
runner 'Setting.reload_settings!'
end