Enhance DiskFS initialization and error handling

- Updated `disk.New` to support asynchronous initialization for large caches, improving responsiveness during startup.
- Introduced an eviction function parameter to `disk.New`, ensuring proper handling of over-capacity scenarios.
- Enhanced error handling in various components, including memory and disk tests, to ensure robustness and clarity.
- Refactored tests to validate new behaviors, including checks for delayed attachment and proper error propagation.
- Removed obsolete error handling code and tests related to the now-deleted errors package, streamlining the codebase.
This commit is contained in:
2026-05-27 13:15:33 -05:00
parent 4861f93e6f
commit feda55e225
18 changed files with 584 additions and 1380 deletions
+5 -1
View File
@@ -141,7 +141,11 @@ var rootCmd = &cobra.Command{
logger.Logger.Info().
Msg("steamcache2 " + version.Version + " started on " + cfg.ListenAddress)
sc.Run()
if err := sc.Run(); err != nil {
logger.Logger.Error().Err(err).Msg("steamcache2 Run failed")
fmt.Fprintf(os.Stderr, "Error: steamcache2 run error: %v\n", err)
os.Exit(1)
}
logger.Logger.Info().Msg("steamcache2 stopped")
os.Exit(0)