mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
refactor: update method receivers to value type for cleanup and connection methods; enhance context usage for task client operations
This commit is contained in:
@@ -162,7 +162,10 @@ func (svc *WorkerService) subscribe() {
|
||||
svc.Errorf("failed to get node client: %v", err)
|
||||
return err
|
||||
}
|
||||
stream, err := nodeClient.Subscribe(context.Background(), &grpc.NodeServiceSubscribeRequest{
|
||||
// Use client context for proper cancellation
|
||||
ctx, cancel := client.GetGrpcClient().Context()
|
||||
defer cancel()
|
||||
stream, err := nodeClient.Subscribe(ctx, &grpc.NodeServiceSubscribeRequest{
|
||||
NodeKey: svc.cfgSvc.GetNodeKey(),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user