Skip to content

Commit

Permalink
sync time if buf not empty (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaGolomozy authored Sep 4, 2024
1 parent 61ce46e commit 8394cb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ func (manager *LoggerManager) AddLogLine(Severity uint, Text interface{}, Catego

// SendBulk send logs bulk to Coralogix
func (manager *LoggerManager) SendBulk(SyncTime bool) bool {
if SyncTime {
manager.UpdateTimeDeltaInterval()
}

BufferLenToSend := manager.LogsBuffer.Len()
if BufferLenToSend < 1 {
DebugLogger.Println("buffer is empty, there is nothing to send!")
return false
}

if SyncTime {
manager.UpdateTimeDeltaInterval()
}

for manager.LogsBuffer.Size() > MaxLogChunkSize && BufferLenToSend > 1 {
BufferLenToSend = BufferLenToSend / 2
}
Expand Down

0 comments on commit 8394cb7

Please sign in to comment.