Revert using 'logger' in cron jobs until it works
This commit is contained in:
parent
9483882acf
commit
67439f5940
1 changed files with 2 additions and 2 deletions
4
vedia.rb
4
vedia.rb
|
|
@ -562,11 +562,11 @@ end
|
|||
|
||||
def close_expired_votes
|
||||
Vote.where(state: 'open').where("expire_on < :now", { now: Time.now.utc }).each do |vote|
|
||||
logger.info "#{Time.now.utc} Closing vote \"#{vote.title}\" because it expired on #{vote.expire_on}..."
|
||||
puts "#{Time.now.utc} Closing vote \"#{vote.title}\" because it expired on #{vote.expire_on}..."
|
||||
vote.state = 'closed'
|
||||
vote.save
|
||||
User.all.each do |user|
|
||||
logger.info "#{Time.now.utc} Sending results by email to #{user.email}..."
|
||||
puts "#{Time.now.utc} Sending results by email to #{user.email}..."
|
||||
mail = Mail.new
|
||||
mail.from = settings.admin_email
|
||||
mail.to = user.email
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue