mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 16:45:15 +03:00
refactor: defer close connection or file
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user