]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use single reference time in fuzzy_convert utility 1099/head
authorAndrew Lewis <nerf@judo.za.org>
Fri, 4 Nov 2016 07:33:15 +0000 (09:33 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 4 Nov 2016 07:33:15 +0000 (09:33 +0200)
src/rspamadm/fuzzy_convert.lua

index 53a44354ca29b186edf9c53cedd953fb9f96329e..5db3c925b85fd6afbd8fedba1a6c88e32eb83efd 100644 (file)
@@ -148,9 +148,10 @@ return function (args, res)
     return
   end
 
+  local now = util.get_time()
   for row in db:rows('SELECT id, flag, digest, value, time FROM digests') do
 
-    local expire_in = math.floor(util:get_time() - row.time + res['expiry'])
+    local expire_in = math.floor(now - row.time + res['expiry'])
     if expire_in >= 1 then
       table.insert(digests, {row.digest, row.flag, row.value, expire_in})
       num_batch_digests = num_batch_digests + 1