Commit ca48b061c32ec40d4e1adf6da7a207f0db715cfd

Authored by Cyril Mougel
1 parent 33f2ebcf
Exists in master and in 1 other branch production

launch a repairDatabase task on clear_resolved

The task db:clear_resolved can delete a lot of data. I think it can be good to repairDatabase after to avoid a big database.

see #458
Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
lib/tasks/errbit/database.rake
... ... @@ -21,6 +21,7 @@ namespace :errbit do
21 21 task :clear_resolved => :environment do
22 22 count = Problem.resolved.count
23 23 Problem.resolved.each {|problem| problem.destroy }
  24 + Mongoid.config.master.command(:repairDatabase => 1)
24 25 puts "=== Cleared #{count} resolved errors from the database." if count > 0
25 26 end
26 27  
... ...