Worker: do not block RPCv2 when performing forwarding ports and resolving IPs (#306)

* Worker: do not block RPCv2 when performing actions

* Do not block RPCv1 with handleGetIP() too
This commit is contained in:
Nikolay Edigaryev
2025-04-16 00:18:02 +04:00
committed by GitHub
parent 3c2de83ea7
commit e3e585778c
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ func (worker *Worker) watchRPC(ctx context.Context) error {
case *rpc.WatchInstruction_SyncVmsAction:
worker.requestVMSyncing()
case *rpc.WatchInstruction_ResolveIpAction:
worker.handleGetIP(ctxWithMetadata, client, action.ResolveIpAction)
go worker.handleGetIP(ctxWithMetadata, client, action.ResolveIpAction)
}
}
}
+2 -2
View File
@@ -20,11 +20,11 @@ func (worker *Worker) watchRPCV2(ctx context.Context) error {
select {
case watchInstruction := <-watchInstructionCh:
if portForwardAction := watchInstruction.PortForwardAction; portForwardAction != nil {
worker.handlePortForwardV2(ctx, portForwardAction)
go worker.handlePortForwardV2(ctx, portForwardAction)
} else if syncVMsAction := watchInstruction.SyncVMsAction; syncVMsAction != nil {
worker.requestVMSyncing()
} else if resolveIPAction := watchInstruction.ResolveIPAction; resolveIPAction != nil {
worker.handleGetIPV2(ctx, resolveIPAction)
go worker.handleGetIPV2(ctx, resolveIPAction)
}
case watchErr := <-watchErrCh:
return watchErr