Revert using 'logger' in cron jobs until it works

This commit is contained in:
ricola 2025-12-16 21:54:05 +01:00
parent 9483882acf
commit 67439f5940

View file

@ -562,11 +562,11 @@ end
def close_expired_votes def close_expired_votes
Vote.where(state: 'open').where("expire_on < :now", { now: Time.now.utc }).each do |vote| 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.state = 'closed'
vote.save vote.save
User.all.each do |user| 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 = Mail.new
mail.from = settings.admin_email mail.from = settings.admin_email
mail.to = user.email mail.to = user.email