Skip to content

Commit

Permalink
Prefer a cutoff date of 6 months
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyprivett committed Nov 15, 2024
1 parent c593e00 commit 24212cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/access_logs.rake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace :access_logs do
desc 'Cleanup access_logs older than 3 months'
desc 'Cleanup access_logs older than 6 months'
task cleanup: [:environment] do
cutoff_date = 3.months.ago
cutoff_date = 6.months.ago
access_logs_count = AccessLog.where('timestamp < ?', cutoff_date).count
number_of_iterations = (access_logs_count.to_f / 1000).ceil

Expand Down

0 comments on commit 24212cb

Please sign in to comment.