mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
adds rake task to destroy ZipExports
This commit is contained in:
parent
b352ef1600
commit
9aeefbdf96
1 changed files with 7 additions and 0 deletions
7
lib/tasks/exportable_items.rake
Normal file
7
lib/tasks/exportable_items.rake
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
namespace :exportable_items do
|
||||||
|
desc 'Removes exportable zip files if older than 3 days'
|
||||||
|
task cleanup: :environment do
|
||||||
|
ZipExport.where('created_at < ?', 3.days.ago).destroy_all
|
||||||
|
puts "All exportable zip files older than '#{3.days.ago}' have been removed"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue