File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,7 @@ func (c *GrpcCfg[T]) WithFactory(clientFactory func(grpc.ClientConnInterface) T)
31
31
32
32
func (* GrpcCfg [T ]) OnUpdate (old , new * GrpcCfg [T ]) {
33
33
ctx := context .Background ()
34
- var err error
35
- new .grpcClient , err = grpcclient .New (new .clientFactory , grpcclient .WithConfig (& new .Config ))
36
- if err != nil {
37
- klog .Errorf (ctx , "GrpcCfg.OnUpdate|grpcclient.New failed|err=%v" , err )
38
- return
39
- }
40
34
41
- new .C = new .grpcClient .C
42
35
if old != nil {
43
36
oldGrpcClient := old .grpcClient
44
37
time .AfterFunc (GrpcCloseDelay , func () {
@@ -47,4 +40,13 @@ func (*GrpcCfg[T]) OnUpdate(old, new *GrpcCfg[T]) {
47
40
}
48
41
})
49
42
}
43
+
44
+ var err error
45
+ new .grpcClient , err = grpcclient .New (new .clientFactory , grpcclient .WithConfig (& new .Config ))
46
+ if err != nil {
47
+ klog .Errorf (ctx , "GrpcCfg.OnUpdate|grpcclient.New failed|err=%v" , err )
48
+ return
49
+ }
50
+
51
+ new .C = new .grpcClient .C
50
52
}
You can’t perform that action at this time.
0 commit comments