This commit is contained in:
a.pivkin 2025-12-23 06:53:20 +03:00
parent 54ce83f458
commit 5ca21e635d
2 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,12 @@ func loggerInit() *zap.SugaredLogger {
if err != nil {
panic(fmt.Sprintf("Logger set up failed: %v", err))
}
defer logger.Sync()
defer func() {
err := logger.Sync()
if err != nil {
logger.Error("couldn't sinc logger")
}
}()
return logger.Sugar()
}

View File

@ -11,7 +11,7 @@ func PoolFactory(cephConn mytypes.CephConnector, poolName string) (mytypes.Pool,
ioctx, err := cephConn.OpenIOContext(poolName)
if err != nil {
return mytypes.Pool{}, fmt.Errorf("Couldn't set context for pool %s %w", poolName, err)
return mytypes.Pool{}, fmt.Errorf("couldn't set context for pool %s %w", poolName, err)
}
defer ioctx.Destroy()