Sha256: 56802b91fa04fbe9417ab26cbbbc8e3f646320e86dd55eed3a69f4940af39729

Contents?: true

Size: 222 Bytes

Versions: 8

Compression:

Stored size: 222 Bytes

Contents

old_histories = Kuroko2::ExecutionHistory.where('finished_at < ?', 2.weeks.ago)

count = old_histories.count

Kuroko2::ExecutionHistories.transaction do
  old_histories.destroy_all
end

puts "Destroyed #{count} histories"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kuroko2-0.8.0 bin/cleanup_old_execution_histories.rb
kuroko2-0.7.0 bin/cleanup_old_execution_histories.rb
kuroko2-0.6.0 bin/cleanup_old_execution_histories.rb
kuroko2-0.5.2 bin/cleanup_old_execution_histories.rb
kuroko2-0.5.1 bin/cleanup_old_execution_histories.rb
kuroko2-0.5.0 bin/cleanup_old_execution_histories.rb
kuroko2-0.4.6 bin/cleanup_old_execution_histories.rb
kuroko2-0.4.5 bin/cleanup_old_execution_histories.rb