fix: implement code review suggestions

Address all feedback from PR review:
- Lock granularity
- Empty response handling
- Shutdown race condition
- Interface naming
This commit is contained in:
Lixeer
2026-02-24 22:33:04 +08:00
parent 3d605a4f53
commit d09c64fcee
4 changed files with 26 additions and 21 deletions
+2 -2
View File
@@ -211,10 +211,10 @@ func gatewayCmd() {
<-sigChan
fmt.Println("\nShutting down...")
cancel()
if cp, ok := provider.(providers.SessionProvider); ok {
if cp, ok := provider.(providers.StatefulProvider); ok {
cp.Close()
}
cancel()
healthServer.Stop(context.Background())
deviceService.Stop()
heartbeatService.Stop()