diff --git a/lib/tasks/cleanup.rake b/lib/tasks/cleanup.rake new file mode 100644 index 0000000..e38794a --- /dev/null +++ b/lib/tasks/cleanup.rake @@ -0,0 +1,12 @@ +namespace :cleanup do + desc "Cleanup completed jobs" + task :jobs => :environment do + Job.completed.destroy_all + end + + # add new jobs here too + task :all => [:jobs] +end + +desc "Cleanup everything" +task :cleanup => 'cleanup:all'