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:
+5
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user