Class: CheckAndNotify::Cron

Inherits:
Object
  • Object
show all
Defined in:
lib/check_and_notify/cron.rb

Class Method Summary collapse

Class Method Details

.initObject



3
4
5
6
# File 'lib/check_and_notify/cron.rb', line 3

def self.init
  init_every_hour_cron
  init_every_ten_minutes_cron
end

.init_every_hour_cronObject



10
11
12
13
14
15
16
# File 'lib/check_and_notify/cron.rb', line 10

def self.init_every_hour_cron
  Sidekiq::Cron::Job.create({
    name: 'CheckEveryHourWorker',
    cron: '0 * * * *',
    class: 'CheckAndNotify::Workers::CheckEveryHourWorker'
  })
end

.init_every_ten_minutes_cronObject



18
19
20
21
22
23
24
# File 'lib/check_and_notify/cron.rb', line 18

def self.init_every_ten_minutes_cron
  Sidekiq::Cron::Job.create({
    name: 'CheckEveryTenMinutesWorker',
    cron: '*/10 * * * *',
    class: 'CheckAndNotify::Workers::CheckEveryTenMinutesWorker'
  })
end

.init_every_thirty_minutes_cronObject



26
27
28
29
30
31
32
# File 'lib/check_and_notify/cron.rb', line 26

def self.init_every_thirty_minutes_cron
  Sidekiq::Cron::Job.create({
    name: 'CheckEveryThirtyMinutesWorker',
    cron: '*/30 * * * *',
    class: 'CheckAndNotify::Workers::CheckEveryThirtyMinutesWorker'
  })
end