Change defer to explicit function call before os.Exit()
This commit is contained in:
parent
4ad1968b2a
commit
01da49db25
1 changed files with 2 additions and 1 deletions
|
@ -62,7 +62,6 @@ func main() {
|
||||||
logger.Printf("Unable to open RPC socket file '%s': '%s'", config.RPCSocketPath, err)
|
logger.Printf("Unable to open RPC socket file '%s': '%s'", config.RPCSocketPath, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
defer rpc.Close()
|
|
||||||
|
|
||||||
reply := ""
|
reply := ""
|
||||||
err = rpc.Call("Status.Downloads", &queue.RPCArgs{}, &reply)
|
err = rpc.Call("Status.Downloads", &queue.RPCArgs{}, &reply)
|
||||||
|
@ -76,6 +75,8 @@ func main() {
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("No Downloads")
|
fmt.Println("No Downloads")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpc.Close()
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue