Skip to content
Snippets Groups Projects
Commit 510982d7 authored by lmtd21's avatar lmtd21
Browse files

Issue #23: CREATE drafts cleanup task

parent 0cb800cb
Branches
No related tags found
1 merge request!23Issue #23: CREATE drafts cleanup task
Pipeline #32077 failed
......@@ -39,6 +39,8 @@
# Learn more: http://github.com/javan/whenever
# update score of learning objects
set :output, "log/cron.log"
every 1.days do
rake 'score:calculate_sync'
end
......@@ -47,3 +49,7 @@ end
every :sunday, at: '3am' do
rake 'submission:reassign'
end
every :sunday, at: '21:00am' do
rake 'delete_empty_drafts:drafts_cleanup'
end
namespace :delete_empty_drafts do
desc 'Delete learning objects with empty names'
task :drafts_cleanup => :environment do
LearningObject.all.each do |lo|
if (lo.name.blank?)
lo.destroy
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment