From e993f4be927a993c3d1abd21d58085625e953355 Mon Sep 17 00:00:00 2001 From: Savorboard Date: Fri, 7 Sep 2018 18:10:48 +0800 Subject: [PATCH] Fix flush unclaer data bugs. --- src/DotNetCore.CAP/ICapTransaction.Base.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DotNetCore.CAP/ICapTransaction.Base.cs b/src/DotNetCore.CAP/ICapTransaction.Base.cs index 141a300..ebf002e 100644 --- a/src/DotNetCore.CAP/ICapTransaction.Base.cs +++ b/src/DotNetCore.CAP/ICapTransaction.Base.cs @@ -23,13 +23,15 @@ namespace DotNetCore.CAP { _bufferList.Add(msg); } - - protected void Flush() + + protected virtual void Flush() { foreach (var message in _bufferList) { _dispatcher.EnqueueToPublish(message); } + + _bufferList.Clear(); } public abstract void Commit();