Cleanup Websocket connections to prevent FD leak
This commit is contained in:
parent
cf7827c120
commit
3f27f5c943
1 changed files with 2 additions and 0 deletions
|
@ -89,6 +89,8 @@ func connectToServer(ctx context.Context, uuid uuid.UUID) {
|
|||
c, res, err := websocket.Dial(ctx, conf.Worker.Address+"/worker", &websocket.DialOptions{
|
||||
HTTPHeader: headers,
|
||||
})
|
||||
defer c.CloseNow()
|
||||
|
||||
if err != nil {
|
||||
if res != nil {
|
||||
b, _ := io.ReadAll(res.Body)
|
||||
|
|
Loading…
Add table
Reference in a new issue