Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: client/logdog/butler/butler.go

Issue 2153383003: LogDog: Actually use default max buffer age. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package butler 5 package butler
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 bc := bundler.Config{ 143 bc := bundler.Config{
144 Clock: clock.Get(ctx), 144 Clock: clock.Get(ctx),
145 Project: config.Project, 145 Project: config.Project,
146 Prefix: config.Prefix, 146 Prefix: config.Prefix,
147 MaxBufferedBytes: streamBufferSize, 147 MaxBufferedBytes: streamBufferSize,
148 MaxBundleSize: config.Output.MaxSize(), 148 MaxBundleSize: config.Output.MaxSize(),
149 } 149 }
150 if config.BufferLogs { 150 if config.BufferLogs {
151 bc.MaxBufferDelay = config.MaxBufferAge 151 bc.MaxBufferDelay = config.MaxBufferAge
152 if bc.MaxBufferDelay <= 0 {
153 bc.MaxBufferDelay = DefaultMaxBufferAge
154 }
152 } 155 }
153 lb := bundler.New(bc) 156 lb := bundler.New(bc)
154 157
155 b := &Butler{ 158 b := &Butler{
156 c: &config, 159 c: &config,
157 ctx: ctx, 160 ctx: ctx,
158 161
159 bundler: lb, 162 bundler: lb,
160 bundlerDrainedC: make(chan struct{}), 163 bundlerDrainedC: make(chan struct{}),
161 164
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 // shutdown prematurely, so this should be reasonably quick. 541 // shutdown prematurely, so this should be reasonably quick.
539 b.Activate() 542 b.Activate()
540 } 543 }
541 544
542 // Returns the configured Butler error. 545 // Returns the configured Butler error.
543 func (b *Butler) getRunErr() error { 546 func (b *Butler) getRunErr() error {
544 b.shutdownMu.Lock() 547 b.shutdownMu.Lock()
545 defer b.shutdownMu.Unlock() 548 defer b.shutdownMu.Unlock()
546 return b.runErr 549 return b.runErr
547 } 550 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698