📎 Port some auditlog changes from develop.

This commit is contained in:
Andrey Antukh 2021-09-29 10:46:31 +02:00
parent 133c0312be
commit 8dba55d5cb
2 changed files with 7 additions and 9 deletions

View file

@ -230,7 +230,7 @@
"select * from audit_log "select * from audit_log
where archived_at is null where archived_at is null
order by created_at asc order by created_at asc
limit 100 limit 1000
for update skip locked;") for update skip locked;")
(defn archive-events (defn archive-events
@ -288,13 +288,11 @@
xform (comp (map decode-row) xform (comp (map decode-row)
(map row->event)) (map row->event))
events (into [] xform rows)] events (into [] xform rows)]
(when-not (empty? events)
(l/debug :action "archive-events" :uri uri :events (count events)) (l/debug :action "archive-events" :uri uri :events (count events))
(if (empty? events)
:empty
(do
(send events) (send events)
(mark-as-archived conn rows) (mark-as-archived conn rows)
:continue)))))) :continue)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; GC Task ;; GC Task

View file

@ -215,7 +215,7 @@
:task :audit-archive}) :task :audit-archive})
(when (cf/get :audit-archive-gc-enabled) (when (cf/get :audit-archive-gc-enabled)
{:cron #app/cron "0 0 * * * ?" ;; every 1h {:cron #app/cron "0 */3 * * * ?" ;; every 3m
:task :audit-archive-gc}) :task :audit-archive-gc})
(when (cf/get :telemetry-enabled) (when (cf/get :telemetry-enabled)