service.Run supports passing in context (#3504)

This commit is contained in:
fatedier authored and GitHub committed 2023-06-29 18:04:20 +08:00
1 parent 801e8c6742
commit 4c4d5f0d0d
5 files changed
+39 -18

No files matched your search

+2 -1
View File
@@ -15,6 +15,7 @@
package sub
import (
"context"
"fmt"
"io/fs"
"net"
@@ -233,7 +234,7 @@ func startService(
go handleSignal(svr, closedDoneCh)
}
err = svr.Run()
err = svr.Run(context.Background())
if err == nil && shouldGracefulClose {
<-closedDoneCh
}