Skip to content

Commit

Permalink
remove maxPriority
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhengl committed Jul 31, 2024
1 parent f2b1366 commit 061a020
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions cmd/zoekt-sourcegraph-indexserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,6 @@ type rootConfig struct {
targetSize int64
minSize int64
minAgeDays int
maxPriority float64

// config values related to backoff indexing repos with one or more consecutive failures
backoffDuration time.Duration
Expand All @@ -1242,7 +1241,6 @@ func (rc *rootConfig) registerRootFlags(fs *flag.FlagSet) {
fs.Int64Var(&rc.targetSize, "merge_target_size", getEnvWithDefaultInt64("SRC_MERGE_TARGET_SIZE", 2000), "the target size of compound shards in MiB")
fs.Int64Var(&rc.minSize, "merge_min_size", getEnvWithDefaultInt64("SRC_MERGE_MIN_SIZE", 1800), "the minimum size of a compound shard in MiB")
fs.IntVar(&rc.minAgeDays, "merge_min_age", getEnvWithDefaultInt("SRC_MERGE_MIN_AGE", 7), "the time since the last commit in days. Shards with newer commits are excluded from merging.")
fs.Float64Var(&rc.maxPriority, "merge_max_priority", getEnvWithDefaultFloat64("SRC_MERGE_MAX_PRIORITY", math.MaxFloat64), "the maximum priority a shard can have to be considered for merging.")
}

func startServer(conf rootConfig) error {
Expand Down Expand Up @@ -1455,7 +1453,6 @@ func newServer(conf rootConfig) (*Server, error) {
targetSizeBytes: conf.targetSize * 1024 * 1024,
minSizeBytes: conf.minSize * 1024 * 1024,
minAgeDays: conf.minAgeDays,
maxPriority: conf.maxPriority,
},
timeout: indexingTimeout,
}, err
Expand Down
7 changes: 0 additions & 7 deletions cmd/zoekt-sourcegraph-indexserver/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ type mergeOpts struct {
// merging. For example, a value of 7 means that only repos that have been
// inactive for 7 days will be considered for merging.
minAgeDays int

// the MAX priority a shard can have to be considered for merging.
maxPriority float64
}

// isExcluded returns true if a shard should not be merged, false otherwise.
Expand Down Expand Up @@ -213,10 +210,6 @@ func isExcluded(path string, fi os.FileInfo, opts mergeOpts) bool {
return true
}

if priority, err := strconv.ParseFloat(repos[0].RawConfig["priority"], 64); err == nil && priority > opts.maxPriority {
return true
}

return false
}

Expand Down

0 comments on commit 061a020

Please sign in to comment.