chore: capture post-P0/P1 state for clean P2 start (working tree was dirty at task begin)

This commit is contained in:
2026-05-27 00:53:49 -05:00
parent 9cb38a9a18
commit 0c1840d223
17 changed files with 1500 additions and 170 deletions
+19 -1
View File
@@ -108,7 +108,16 @@ var rootCmd = &cobra.Command{
finalMaxRequestsPerClient = maxRequestsPerClient
}
sc := steamcache.New(
// Validate after loading and applying CLI overrides (fail fast, do not create default on validate error)
if err := cfg.Validate(); err != nil {
logger.Logger.Error().
Err(err).
Msg("Configuration validation failed")
fmt.Fprintf(os.Stderr, "Error: Invalid configuration: %v. Please fix the config file and try again.\n", err)
os.Exit(1)
}
sc, err := steamcache.New(
cfg.ListenAddress,
cfg.Cache.Memory.Size,
cfg.Cache.Disk.Size,
@@ -118,7 +127,16 @@ var rootCmd = &cobra.Command{
cfg.Cache.Disk.GCAlgorithm,
finalMaxConcurrentRequests,
finalMaxRequestsPerClient,
cfg.MaxObjectSize,
cfg.TrustedProxies,
)
if err != nil {
logger.Logger.Error().
Err(err).
Msg("Failed to initialize steamcache")
fmt.Fprintf(os.Stderr, "Error: Failed to initialize steamcache: %v. Check sizes in config.\n", err)
os.Exit(1)
}
logger.Logger.Info().
Msg("steamcache2 " + version.Version + " started on " + cfg.ListenAddress)