lib/tasks/pghero.rake in pghero-3.1.0 vs lib/tasks/pghero.rake in pghero-3.2.0
- old
+ new
@@ -20,8 +20,18 @@
end
desc "Remove old query stats"
task clean_query_stats: :environment do
puts "Deleting old query stats..."
- PgHero.clean_query_stats
+ options = {}
+ options[:before] = Float(ENV["KEEP_DAYS"]).days.ago if ENV["KEEP_DAYS"].present?
+ PgHero.clean_query_stats(**options)
+ end
+
+ desc "Remove old space stats"
+ task clean_space_stats: :environment do
+ puts "Deleting old space stats..."
+ options = {}
+ options[:before] = Float(ENV["KEEP_DAYS"]).days.ago if ENV["KEEP_DAYS"].present?
+ PgHero.clean_space_stats(**options)
end
end