refactor: defer close connection or file

This commit is contained in:
2026-05-05 14:34:00 +03:00
parent ea5cca09f5
commit 7a53c1dc9f
19 changed files with 859 additions and 52 deletions
+5 -1
View File
@@ -55,7 +55,11 @@ func (a *App) Run() {
a.log.Info().Msg("connection to the hub successful")
conn := rpc.NewConnectAgent(GRPCConn)
defer conn.Close()
defer func() {
if err := conn.Close(); err != nil {
a.log.Warn().Err(err).Msg("failed to close rpc connection")
}
}()
var DockerService collector.Docker