mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 20:24:43 +08:00
9 lines
324 B
Ruby
9 lines
324 B
Ruby
namespace :exportable_items do
|
|
desc 'Removes exportable zip files'
|
|
task cleanup: :environment do
|
|
num = Constants::EXPORTABLE_ZIP_EXPIRATION_DAYS
|
|
ZipExport.where('created_at < ?', num.days.ago).destroy_all
|
|
puts "All exportable zip files older than " \
|
|
"'#{num.days.ago}' have been removed"
|
|
end
|
|
end
|