Class: MailManager::MailingJob
- Inherits:
-
Struct
- Object
- Struct
- MailManager::MailingJob
- Defined in:
- lib/workers/mail_manager/mailing_job.rb
Instance Attribute Summary collapse
-
#repeats_every ⇒ Object
Returns the value of attribute repeats_every.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#repeats_every ⇒ Object
Returns the value of attribute repeats_every
10 11 12 |
# File 'lib/workers/mail_manager/mailing_job.rb', line 10 def repeats_every @repeats_every end |
Class Method Details
.get_ready ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/workers/mail_manager/mailing_job.rb', line 21 def self.get_ready MailManager::Lock.with_lock('mail_manager_mailing_job_ready') do |lock| mailing = Mailing.ready.first return nil if mailing.nil? mailing.change_status('processing') return mailing end end |
.run ⇒ Object
14 15 16 17 18 19 |
# File 'lib/workers/mail_manager/mailing_job.rb', line 14 def self.run while(mailing=get_ready) do mailing.deliver end Rails.logger.info "No ready mailings #{Time.now}" end |
Instance Method Details
#perform ⇒ Object
11 12 13 |
# File 'lib/workers/mail_manager/mailing_job.rb', line 11 def perform MailingJob.run end |