mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-22 06:18:16 +02:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user