Merge branch 'master' into 8019-crunchrun-log-throttle
[arvados.git] / services / api / lib / audit_logs.rb
index 8a5a6306b4082cf48970076f30ae6f39c9aea3a7..ddbf2d01dd37c6ad885c7c1f3ac2f3761003f0bb 100644 (file)
@@ -15,7 +15,7 @@ module AuditLogs
       File.open(lockfile, File::RDWR|File::CREAT, 0600) do |f|
         return unless f.flock(File::LOCK_NB|File::LOCK_EX)
 
-        sql = "select clock_timestamp() - interval '#{max_age} seconds'"
+        sql = "select clock_timestamp() - interval '#{'%.9f' % max_age} seconds'"
         threshold = ActiveRecord::Base.connection.select_value(sql).to_time.utc
         Rails.logger.info "AuditLogs: deleting logs older than #{threshold}"