File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,6 @@ impl ComputeHandler for WorkflowHandler {
161
161
} ;
162
162
163
163
// try publishing the result
164
-
165
164
if let Err ( publish_err) = node. publish ( message) {
166
165
let err_msg = format ! ( "Could not publish result: {:?}" , publish_err) ;
167
166
log:: error!( "{}" , err_msg) ;
Original file line number Diff line number Diff line change @@ -156,8 +156,6 @@ impl DriaComputeNode {
156
156
log:: debug!( "{:?}" , self . p2p. network_info( ) . connection_counters( ) ) ;
157
157
}
158
158
159
-
160
-
161
159
let ( peer_id, message_id, message) = event;
162
160
let topic = message. topic. clone( ) ;
163
161
let topic_str = topic. as_str( ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ use crate::DriaNetworkType;
11
11
/// Number of seconds between refreshing the available nodes.
12
12
const DEFAULT_REFRESH_INTERVAL_SECS : u64 = 25 ;
13
13
14
+ impl DriaNetworkType {
15
+ /// Returns the URL for fetching available nodes w.r.t network type.
16
+ pub fn get_available_nodes_url ( & self ) -> & str {
17
+ match self {
18
+ DriaNetworkType :: Community => "https://dkn.dria.co/available-nodes" ,
19
+ DriaNetworkType :: Pro => "https://dkn.dria.co/sdk/available-nodes" ,
20
+ }
21
+ }
22
+ }
14
23
/// Available nodes within the hybrid P2P network.
15
24
///
16
25
/// - Bootstrap: used for Kademlia DHT bootstrap.
@@ -98,11 +107,7 @@ impl AvailableNodes {
98
107
}
99
108
100
109
// make the request w.r.t network type
101
- let url = match self . network_type {
102
- DriaNetworkType :: Community => "https://dkn.dria.co/available-nodes" ,
103
- DriaNetworkType :: Pro => "https://dkn.dria.co/sdk/available-nodes" ,
104
- } ;
105
- let response = reqwest:: get ( url) . await ?;
110
+ let response = reqwest:: get ( self . network_type . get_available_nodes_url ( ) ) . await ?;
106
111
let response_body = response. json :: < AvailableNodesApiResponse > ( ) . await ?;
107
112
self . bootstrap_nodes
108
113
. extend ( parse_vec ( response_body. bootstraps ) . into_iter ( ) ) ;
You can’t perform that action at this time.
0 commit comments