File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"fmt"
6
6
"strings"
7
+ "sync"
7
8
"time"
8
9
9
10
"github.com/btcsuite/btcd/btcec"
@@ -20,6 +21,17 @@ type sessionRpcServer struct {
20
21
21
22
db * session.DB
22
23
sessionServer * session.Server
24
+
25
+ quit chan struct {}
26
+
27
+ stopOnce sync.Once
28
+ }
29
+
30
+ // stop cleans up any sessionRpcServer resources.
31
+ func (s * sessionRpcServer ) stop () {
32
+ s .stopOnce .Do (func () {
33
+ close (s .quit )
34
+ })
23
35
}
24
36
25
37
// AddSession adds and starts a new Terminal Connect session.
Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ func (g *LightningTerminal) Run() error {
227
227
basicAuth : g .rpcProxy .basicAuth ,
228
228
db : g .sessionDB ,
229
229
sessionServer : g .sessionServer ,
230
+ quit : make (chan struct {}),
230
231
}
231
232
232
233
// Now start up all previously created sessions.
@@ -838,6 +839,7 @@ func (g *LightningTerminal) shutdown() error {
838
839
}
839
840
}
840
841
842
+ g .sessionRpcServer .stop ()
841
843
if err := g .sessionDB .Close (); err != nil {
842
844
log .Errorf ("Error closing session DB: %v" , err )
843
845
returnErr = err
You can’t perform that action at this time.
0 commit comments