|
|
|
@@ -41,10 +41,10 @@ func (s *Service) SendIOStream(ctx context.Context, req *hubrpc.SendIOStream) (* |
|
|
|
Debugf("stream input") |
|
|
|
|
|
|
|
// 同一批Plan中每个节点的Plan的启动时间有先后,但最多不应该超过30秒 |
|
|
|
ctx, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
ctx2, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
sw := s.swWorker.FindByIDContexted(ctx, exec.PlanID(req.PlanID)) |
|
|
|
sw := s.swWorker.FindByIDContexted(ctx2, exec.PlanID(req.PlanID)) |
|
|
|
if sw == nil { |
|
|
|
return nil, rpc.Failed(errorcode.DataNotFound, "plan not found") |
|
|
|
} |
|
|
|
@@ -72,10 +72,10 @@ func (s *Service) GetIOStream(ctx context.Context, req *hubrpc.GetIOStream) (*hu |
|
|
|
Debugf("stream output") |
|
|
|
|
|
|
|
// 同上 |
|
|
|
ctx, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
ctx2, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
sw := s.swWorker.FindByIDContexted(ctx, exec.PlanID(req.PlanID)) |
|
|
|
sw := s.swWorker.FindByIDContexted(ctx2, exec.PlanID(req.PlanID)) |
|
|
|
if sw == nil { |
|
|
|
return nil, rpc.Failed(errorcode.DataNotFound, "plan not found") |
|
|
|
} |
|
|
|
@@ -93,10 +93,10 @@ func (s *Service) GetIOStream(ctx context.Context, req *hubrpc.GetIOStream) (*hu |
|
|
|
} |
|
|
|
|
|
|
|
func (s *Service) SendIOVar(ctx context.Context, req *hubrpc.SendIOVar) (*hubrpc.SendIOVarResp, *rpc.CodeError) { |
|
|
|
ctx, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
ctx2, cancel := context.WithTimeout(ctx, time.Second*30) |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
sw := s.swWorker.FindByIDContexted(ctx, exec.PlanID(req.PlanID)) |
|
|
|
sw := s.swWorker.FindByIDContexted(ctx2, exec.PlanID(req.PlanID)) |
|
|
|
if sw == nil { |
|
|
|
return nil, rpc.Failed(errorcode.DataNotFound, "plan not found") |
|
|
|
} |
|
|
|
|