From 13c26486b621a8345f4386d2d65f1769e167f984 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 4 Jul 2024 23:08:22 +0800 Subject: [PATCH] :bug: Fix clear function doesn't real clear items in slice --- pkg/internal/services/events.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/internal/services/events.go b/pkg/internal/services/events.go index 769b65d..295e7fa 100644 --- a/pkg/internal/services/events.go +++ b/pkg/internal/services/events.go @@ -37,12 +37,12 @@ func SaveEventChanges() { count := len(writeEventQueue) database.C.CreateInBatches(writeEventQueue, min(count, 1000)) log.Info().Int("count", count).Msg("Saved action events changes into database...") - clear(writeEventQueue) + writeEventQueue = nil } if len(writeAuditQueue) > 0 { count := len(writeAuditQueue) database.C.CreateInBatches(writeAuditQueue, min(count, 1000)) log.Info().Int("count", count).Msg("Saved audit records changes into database...") - clear(writeAuditQueue) + writeAuditQueue = nil } }