Skip to content

Commit 4857695

Browse files
committed
fix: reorder defers so cleanup runs before closing done channel
1 parent 715ebfa commit 4857695

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,8 @@ type logQueuer struct {
516516
}
517517

518518
func (l *logQueuer) work(ctx context.Context, done chan struct{}) {
519-
defer l.cleanup()
520519
defer close(done)
520+
defer l.cleanup()
521521

522522
for ctx.Err() == nil {
523523
select {

0 commit comments

Comments
 (0)