Skip to content

Commit

Permalink
Flush() is no-op if no logs are buffered
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettj12 committed Aug 2, 2023
1 parent 22a6968 commit 8f820a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internals/overlord/logstate/loki.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func asLokiEntry(entry servicelog.Entry) lokiEntry {
}

func (c *lokiClient) Flush(ctx context.Context) error {
if c.numEntries() == 0 {
return nil // no-op
}

defer func() {
for svc := range c.entries {
c.entries[svc] = c.entries[svc][:0]
Expand Down

0 comments on commit 8f820a6

Please sign in to comment.