Commit 8347704

Nick Faro committed on
Name small-push thresholds
commit 834770464d8f7a557f34c3ded9073b26be0511ac parent 539a482
1 changed files +5−3
Modifiedinternal/publish/publish.go +5−3
@@ -14,8 +14,10 @@ import (
14 ) 14 )
15 15
16 const ( 16 const (
17 mutableCache = "no-cache, max-age=0, must-revalidate" 17 mutableCache = "no-cache, max-age=0, must-revalidate"
18 immutableCache = "public, max-age=31536000, immutable" 18 immutableCache = "public, max-age=31536000, immutable"
19 smallPushMaxBytes = 8 << 20
20 smallPushMaxObjects = 64
19 ) 21 )
20 22
21 type Update struct { 23 type Update struct {
@@ -150,7 +152,7 @@ func (p *Publisher) Push(ctx context.Context, updates []Update, expected map[str
150 packAdded := false 152 packAdded := false
151 refsPublishedEarly := false 153 refsPublishedEarly := false
152 if pack != nil && pack.Objects > 0 { 154 if pack != nil && pack.Objects > 0 {
153 looseObjects, useLoose, looseErr := p.Git.SmallLooseObjects(ctx, pack, 64, 8<<20) 155 looseObjects, useLoose, looseErr := p.Git.SmallLooseObjects(ctx, pack, smallPushMaxObjects, smallPushMaxBytes)
154 if looseErr != nil { 156 if looseErr != nil {
155 return Result{}, looseErr 157 return Result{}, looseErr
156 } 158 }