From fd7767148061d21b77bd97a8856191d6c9bbc077 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 23 Mar 2017 15:56:16 -0400 Subject: [PATCH] 11065: Avoid scientific notation in PostgreSQL literal. --- services/api/lib/audit_logs.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/api/lib/audit_logs.rb b/services/api/lib/audit_logs.rb index 8a5a6306b4..ddbf2d01dd 100644 --- a/services/api/lib/audit_logs.rb +++ b/services/api/lib/audit_logs.rb @@ -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}" -- 2.30.2