Skip to content

Commit

Permalink
To ensure the program is restarted if the agent is already running
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Jan 15, 2024
1 parent 150f909 commit a8712f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions forwarder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ func (v *Views) run(config Config, interrupt chan os.Signal) {
close(errorChannel)
}
}()
defer func(c *websocket.Conn) {
_ = c.Close()
}(c)
response := specialTransporter.InitiationTransporter{
Server: server.Forwarder,
Version: Version,
Expand Down
3 changes: 3 additions & 0 deletions recorder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ func (v *Views) run(config Config, interrupt chan os.Signal) {
close(errorChannel)
}
}()
defer func(c *websocket.Conn) {
_ = c.Close()
}(c)
response := specialTransporter.InitiationTransporter{
Server: server.Recorder,
Version: Version,
Expand Down

0 comments on commit a8712f4

Please sign in to comment.