Skip to content

Commit

Permalink
fix: add flush check logic
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
  • Loading branch information
hlts2 committed Sep 9, 2024
1 parent 833ccf7 commit 50861c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/agent/core/ngt/service/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -1941,21 +1941,21 @@ func (n *ngt) gc() {
}

func (n *ngt) Len() uint64 {
if n != nil && n.kvs != nil {
if n != nil && n.kvs != nil && !n.IsFlushing() {
return n.kvs.Len()
}
return 0

Check warning on line 1947 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1947

Added line #L1947 was not covered by tests
}

func (n *ngt) InsertVQueueBufferLen() uint64 {
if n != nil && n.vq != nil {
if n != nil && n.kvs != nil && !n.IsFlushing() {
return uint64(n.vq.IVQLen())
}
return 0

Check warning on line 1954 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1954

Added line #L1954 was not covered by tests
}

func (n *ngt) DeleteVQueueBufferLen() uint64 {
if n != nil && n.vq != nil {
if n != nil && n.kvs != nil && !n.IsFlushing() {
return uint64(n.vq.DVQLen())
}
return 0

Check warning on line 1961 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1961

Added line #L1961 was not covered by tests
Expand Down

0 comments on commit 50861c7

Please sign in to comment.