Skip to content

Commit

Permalink
Merge pull request #1934 from tonistiigi/clip-fix
Browse files Browse the repository at this point in the history
logs: fix clipping configuration
  • Loading branch information
AkihiroSuda authored Jan 14, 2021
2 parents 08e9013 + f3e6120 commit e48badb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions util/progress/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"github.com/tonistiigi/units"
)

var defaultMaxLogSize = 1024 * 1024
var defaultMaxLogSpeed = 100 * 1024 // per second
var defaultMaxLogSize = 2 * 1024 * 1024
var defaultMaxLogSpeed = 200 * 1024 // per second

const (
stdout = 1
Expand Down Expand Up @@ -71,15 +71,16 @@ func (sw *streamWriter) checkLimit(n int) int {
maxSize = int(math.Ceil(time.Since(sw.created).Seconds())) * defaultMaxLogSpeed
sw.clipReasonSpeed = true
}
if maxSize > defaultMaxLogSize {
if maxSize == -1 || maxSize > defaultMaxLogSize {
maxSize = defaultMaxLogSize
sw.clipReasonSpeed = false
}
if maxSize < oldSize {
return 0
}

if maxSize != -1 {
if maxSize < oldSize {
return 0
}

if sw.size > maxSize {
return maxSize - oldSize
}
Expand Down

0 comments on commit e48badb

Please sign in to comment.