Class: Taskr::Actions::RotateTaskLog

Inherits:
Base
  • Object
show all
Defined in:
lib/taskr/actions.rb

Instance Attribute Summary

Attributes inherited from Base

#parameters, #task, #task_action

Instance Method Summary collapse

Methods inherited from Base

#initialize, #to_s, #trigger

Constructor Details

This class inherits a constructor from Taskr::Actions::Base

Instance Method Details

#executeObject



122
123
124
125
126
127
128
# File 'lib/taskr/actions.rb', line 122

def execute
  num = parameters['delete_old_log_entries_after_days'].to_i
  
  cond = ['timestamp < ?', Time.now - num.days]
  LogEntry.delete_all(cond)
  LogEntry.debug(task_action, "Deleted log entries with conditions: #{cond.inspect}")
end