mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
aggregated logs has empty flushFn
This commit is contained in:
parent
0b17b379a8
commit
224103e13b
|
@ -145,13 +145,16 @@ func (m *LogBuffer) loopInterval() {
|
||||||
|
|
||||||
func (m *LogBuffer) copyToFlush() *dataToFlush {
|
func (m *LogBuffer) copyToFlush() *dataToFlush {
|
||||||
|
|
||||||
if m.flushFn != nil && m.pos > 0 {
|
if m.pos > 0 {
|
||||||
// fmt.Printf("flush buffer %d pos %d empty space %d\n", len(m.buf), m.pos, len(m.buf)-m.pos)
|
// fmt.Printf("flush buffer %d pos %d empty space %d\n", len(m.buf), m.pos, len(m.buf)-m.pos)
|
||||||
d := &dataToFlush{
|
var d *dataToFlush
|
||||||
|
if m.flushFn != nil {
|
||||||
|
d = &dataToFlush{
|
||||||
startTime: m.startTime,
|
startTime: m.startTime,
|
||||||
stopTime: m.stopTime,
|
stopTime: m.stopTime,
|
||||||
data: copiedBytes(m.buf[:m.pos]),
|
data: copiedBytes(m.buf[:m.pos]),
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// fmt.Printf("flusing [0,%d) with %d entries\n", m.pos, len(m.idx))
|
// fmt.Printf("flusing [0,%d) with %d entries\n", m.pos, len(m.idx))
|
||||||
m.buf = m.prevBuffers.SealBuffer(m.startTime, m.stopTime, m.buf, m.pos)
|
m.buf = m.prevBuffers.SealBuffer(m.startTime, m.stopTime, m.buf, m.pos)
|
||||||
m.pos = 0
|
m.pos = 0
|
||||||
|
|
Loading…
Reference in a new issue