Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/gitaly/config/config.go')
-rw-r--r--internal/gitaly/config/config.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/internal/gitaly/config/config.go b/internal/gitaly/config/config.go
index 222081d01..db46d4b32 100644
--- a/internal/gitaly/config/config.go
+++ b/internal/gitaly/config/config.go
@@ -9,6 +9,7 @@ import (
"path/filepath"
"reflect"
"regexp"
+ "strconv"
"strings"
"syscall"
"time"
@@ -262,9 +263,10 @@ type PackObjectsLimiting struct {
// StreamCacheConfig contains settings for a streamcache instance.
type StreamCacheConfig struct {
- Enabled bool `toml:"enabled"` // Default: false
- Dir string `toml:"dir"` // Default: <FIRST STORAGE PATH>/+gitaly/PackObjectsCache
- MaxAge duration.Duration `toml:"max_age"` // Default: 5m
+ Enabled bool `toml:"enabled"` // Default: false
+ Dir string `toml:"dir"` // Default: <FIRST STORAGE PATH>/+gitaly/PackObjectsCache
+ MaxAge duration.Duration `toml:"max_age"` // Default: 5m
+ MinOccurrences int `toml:"min_occurrences"`
}
// Load initializes the Config variable from file and the environment.
@@ -614,6 +616,11 @@ func (cfg *Cfg) configurePackObjectsCache() error {
return errPackObjectsCacheRelativePath
}
+ // Temporary environment variable for validation on GitLab.com
+ if n, err := strconv.Atoi(os.Getenv("GITALY_PACK_OBJECTS_CACHE_MIN_OCCURRENCES")); err == nil && n > 0 {
+ poc.MinOccurrences = n
+ }
+
return nil
}