diff --git a/lib/foreman_tasks/cleaner.rb b/lib/foreman_tasks/cleaner.rb index 00cce03ee..ea875aced 100644 --- a/lib/foreman_tasks/cleaner.rb +++ b/lib/foreman_tasks/cleaner.rb @@ -252,7 +252,7 @@ def orphaned_dynflow_tasks def prepare_filter filter_parts = [filter] - filter_parts << %(started_at < "#{after.ago.to_s(:db)}") if after > 0 + filter_parts << %(started_at < "#{after.ago.to_formatted_s(:db)}") if after > 0 filter_parts << "state ^ (#{states.join(',')})" if states.any? filter_parts.select(&:present?).map { |segment| "(#{segment})" }.join(' AND ') end diff --git a/lib/foreman_tasks/tasks/export_tasks.rake b/lib/foreman_tasks/tasks/export_tasks.rake index 94437b44f..2f5da1fc7 100644 --- a/lib/foreman_tasks/tasks/export_tasks.rake +++ b/lib/foreman_tasks/tasks/export_tasks.rake @@ -310,15 +310,15 @@ namespace :foreman_tasks do SKIP_ERRORS = ['true', '1', 'y', 'yes'].include? (ENV['SKIP_FAILED'] || '').downcase filter = if ENV['TASK_SEARCH'].nil? && ENV['TASK_DAYS'].nil? - "started_at > \"#{7.days.ago.to_s(:db)}\" || " \ - "(result != success && started_at > \"#{60.days.ago.to_s(:db)})\"" + "started_at > \"#{7.days.ago.to_formatted_s(:db)}\" || " \ + "(result != success && started_at > \"#{60.days.ago.to_formatted_s(:db)})\"" else ENV['TASK_SEARCH'] || '' end if (days = ENV['TASK_DAYS']) filter += ' && ' unless filter == '' - filter += "started_at > \"#{days.to_i.days.ago.to_s(:db)}\"" + filter += "started_at > \"#{days.to_i.days.ago.to_formatted_s(:db)}\"" end format = ENV['TASK_FORMAT'] || 'html'