Changeset 0.21.2 (#88)
This commit is contained in:
@@ -51,6 +51,12 @@ type Config struct {
|
||||
// EXTRACTION_CONCURRENCY: max concurrent extraction jobs (default 3).
|
||||
ExtractionMode string
|
||||
ExtractionConcurrency int
|
||||
|
||||
// Workspace indexing (v0.21.2)
|
||||
// WORKSPACE_INDEXING_ENABLED: global kill switch for workspace file indexing (default true).
|
||||
// WORKSPACE_INDEX_CONCURRENCY: max concurrent indexing goroutines (default 2).
|
||||
WorkspaceIndexingEnabled bool
|
||||
WorkspaceIndexConcurrency int
|
||||
}
|
||||
|
||||
// Load reads configuration from environment variables.
|
||||
@@ -83,6 +89,9 @@ func Load() *Config {
|
||||
S3ForcePathStyle: getEnv("S3_FORCE_PATH_STYLE", "true") == "true",
|
||||
ExtractionMode: getEnv("EXTRACTION_MODE", "inline"),
|
||||
ExtractionConcurrency: getEnvInt("EXTRACTION_CONCURRENCY", 3),
|
||||
|
||||
WorkspaceIndexingEnabled: getEnvBool("WORKSPACE_INDEXING_ENABLED", true),
|
||||
WorkspaceIndexConcurrency: getEnvInt("WORKSPACE_INDEX_CONCURRENCY", 2),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,3 +152,13 @@ func getEnvInt(key string, fallback int) int {
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
func getEnvBool(key string, fallback bool) bool {
|
||||
if v := os.Getenv(key); v != "" {
|
||||
b, err := strconv.ParseBool(v)
|
||||
if err == nil {
|
||||
return b
|
||||
}
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user