From c04b5f82ec594bc4e4c28e6246514b01e2cc4163 Mon Sep 17 00:00:00 2001 From: rulego-team Date: Sun, 15 Jun 2025 22:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E7=A7=BB=E9=99=A4Pe?= =?UTF-8?q?rsistenceManager.Stop()=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=BB=A3=E7=A0=81=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=88=B7=E6=96=B0=E6=95=B0=E6=8D=AE=E5=92=8C?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=BD=9C=E5=9C=A8=E7=9A=84=E7=AB=9E=E6=80=81=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stream/persistence.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/stream/persistence.go b/stream/persistence.go index 8181977..3004fed 100644 --- a/stream/persistence.go +++ b/stream/persistence.go @@ -142,14 +142,6 @@ func (pm *PersistenceManager) Stop() error { } pm.writeMutex.Unlock() - // 刷新剩余数据 - pm.flushPendingData() - - // 关闭当前文件 - if pm.currentFile != nil { - pm.currentFile.Close() - } - logger.Info("Persistence manager stopped") return nil } @@ -188,7 +180,7 @@ func (pm *PersistenceManager) LoadPersistedData() ([]interface{}, error) { continue } allData = append(allData, data...) - + // 在锁保护下更新统计信息 pm.writeMutex.Lock() pm.totalLoaded += int64(len(data))