diff options
| author | chrislu <chris.lu@gmail.com> | 2024-03-16 11:14:14 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-03-16 11:14:14 -0700 |
| commit | 054d0b348785fe087809e1fdd99cb93489602db5 (patch) | |
| tree | 8c231917ba94d0048db4a0a0e03b6605713bd0f0 | |
| parent | f8957b84c1eb1905a44214ebc7ea3c7e1dcab4dd (diff) | |
| download | seaweedfs-054d0b348785fe087809e1fdd99cb93489602db5.tar.xz seaweedfs-054d0b348785fe087809e1fdd99cb93489602db5.zip | |
wait for data
| -rw-r--r-- | weed/util/log_buffer/log_read.go | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index d7ca47155..0354f0e7f 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -66,16 +66,20 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition isDone = true return } - if waitForDataFn() { - continue - } else { - isDone = true - return + lastTsNs := logBuffer.LastTsNs + for lastTsNs == logBuffer.LastTsNs { + if waitForDataFn() { + continue + } else { + isDone = true + return + } } if logBuffer.IsStopping() { isDone = true return } + continue } buf := bytesBuf.Bytes() |
