mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 04:58:29 +02:00
Fix cron logging #2539
This commit is contained in:
parent
e097cac210
commit
8f51d8a867
1 changed files with 2 additions and 2 deletions
|
@ -36,7 +36,7 @@ class Invoice < ActiveRecord::Base
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def cancel_overdue_invoices
|
def cancel_overdue_invoices
|
||||||
logger.info "#{Time.zone.now.utc} - Cancelling overdue invoices\n"
|
STDOUT << "#{Time.zone.now.utc} - Cancelling overdue invoices\n" unless Rails.env.test?
|
||||||
|
|
||||||
cr_at = Time.zone.now - Setting.days_to_keep_overdue_invoices_active.days
|
cr_at = Time.zone.now - Setting.days_to_keep_overdue_invoices_active.days
|
||||||
invoices = Invoice.unbinded.where(
|
invoices = Invoice.unbinded.where(
|
||||||
|
@ -45,7 +45,7 @@ class Invoice < ActiveRecord::Base
|
||||||
|
|
||||||
count = invoices.update_all(cancelled_at: Time.zone.now)
|
count = invoices.update_all(cancelled_at: Time.zone.now)
|
||||||
|
|
||||||
logger.info "#{Time.zone.now.utc} - Successfully cancelled #{count} overdue invoices\n"
|
STDOUT << "#{Time.zone.now.utc} - Successfully cancelled #{count} overdue invoices\n" unless Rails.env.test?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue