Skip to content

Commit

Permalink
don't initatiate time if closed
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Aug 5, 2024
1 parent 06a718a commit c2735ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmap_span/mmap_span.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (ms *MMapSpan) Append(mMap Mmap) {
func (ms *MMapSpan) Flush(onFlush func(size int64)) (errs []error) {
ms.mu.Lock()
defer ms.mu.Unlock()
if ms.flushTimer == nil {
if len(ms.mMaps) > 0 && ms.flushTimer == nil {
ms.flushTimer = time.AfterFunc(ms.FlushTime,
func() {
ms.mu.Lock()
Expand Down

0 comments on commit c2735ad

Please sign in to comment.