Skip to content

Commit 2585641

Browse files
committed
Close connection by end of notification
1 parent f88493d commit 2585641

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

supervisor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type supervisor string
1212
func (s supervisor) notify() {
1313
switch s {
1414
case "systemd":
15+
// TODO: Initialize address and connection in type instead of notify()
1516
socketAddr := &net.UnixAddr{
1617
Name: os.Getenv("NOTIFY_SOCKET"),
1718
Net: "unixgram",
@@ -22,6 +23,7 @@ func (s supervisor) notify() {
2223
}
2324

2425
conn, err := net.DialUnix(socketAddr.Net, nil, socketAddr)
26+
defer conn.Close()
2527
if err != nil {
2628
return
2729
}

0 commit comments

Comments
 (0)