lib/perus/server/db.rb in perus-0.1.6 vs lib/perus/server/db.rb in perus-0.1.7
- old
+ new
@@ -60,10 +60,10 @@
def self.cleanup
puts 'Cleaning old values and metrics'
keep_hours = Server.options.keep_hours
# remove old values
- min_timestamp = Time.now.to_i - (keep_hours * 60)
+ min_timestamp = Time.now.to_i - (keep_hours * 60 * 60)
values = Value.where("timestamp < #{min_timestamp}")
puts "Deleting #{values.count} values"
values.each(&:destroy)
# remove metrics from systems if they no longer have any values