@@ -87,23 +87,22 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
87
87
}
88
88
logrus .WithField ("port" , address ).Tracef ("Upload port" )
89
89
90
- dm := pme .DiscoveryManager ()
91
- watcher , err := dm .Watch ()
90
+ watcher , cancel , err := board .Watch (& rpc.BoardListWatchRequest {Instance : instance })
92
91
if err != nil {
93
92
return nil , err
94
93
}
95
- defer watcher . Close ()
94
+ defer cancel ()
96
95
97
96
deadline := time .After (p .timeout .Get ())
98
97
for {
99
98
select {
100
- case portEvent := <- watcher . Feed () :
101
- if portEvent .Type != "add" {
99
+ case portEvent := <- watcher :
100
+ if portEvent .GetEventType () != "add" {
102
101
continue
103
102
}
104
- port := portEvent .Port
105
- if (protocol == "" || protocol == port .Protocol ) && address == port .Address {
106
- return port . ToRPC () , nil
103
+ port := portEvent .GetPort (). GetPort ()
104
+ if (protocol == "" || protocol == port .GetProtocol ()) && address == port .GetAddress () {
105
+ return port , nil
107
106
}
108
107
109
108
case <- deadline :
0 commit comments