From 045a5156d1fb8d89ec14feb3ea9e25ed6f878ccf Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 29 Sep 2021 09:01:36 +0200 Subject: [PATCH] :paperclip: Minor changes on internal audit archive task params. --- backend/src/app/loggers/audit.clj | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/src/app/loggers/audit.clj b/backend/src/app/loggers/audit.clj index bf370878b..56608e648 100644 --- a/backend/src/app/loggers/audit.clj +++ b/backend/src/app/loggers/audit.clj @@ -229,7 +229,7 @@ "select * from audit_log where archived_at is null order by created_at asc - limit 100 + limit 1000 for update skip locked;") (defn archive-events @@ -287,13 +287,11 @@ xform (comp (map decode-row) (map row->event)) events (into [] xform rows)] - (l/debug :action "archive-events" :uri uri :events (count events)) - (if (empty? events) - :empty - (do - (send events) - (mark-as-archived conn rows) - :continue)))))) + (when-not (empty? events) + (l/debug :action "archive-events" :uri uri :events (count events)) + (send events) + (mark-as-archived conn rows) + :continue))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; GC Task