File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
nts-pool-management/src/routes Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ use std:: collections:: HashSet ;
2+
13use askama:: Template ;
24use axum:: {
35 Json , Router ,
@@ -148,6 +150,10 @@ pub async fn poolke_servers(
148150 _authentication : AuthenticatedInternal ,
149151) -> Result < impl IntoResponse , AppError > {
150152 let timesources = models:: time_source:: list ( & state. db ) . await ?;
153+ let regions: HashSet < _ > = models:: regions:: list_enabled_regions ( & state. db )
154+ . await ?
155+ . into_iter ( )
156+ . collect ( ) ;
151157 Ok ( Json (
152158 timesources
153159 . into_iter ( )
@@ -158,7 +164,11 @@ pub async fn poolke_servers(
158164 base_key_index : 0 ,
159165 randomizer : ts. auth_token_randomizer ,
160166 weight : Some ( ts. weight . try_into ( ) . unwrap_or ( 1 ) ) ,
161- regions : vec ! [ ] ,
167+ regions : ts
168+ . countries
169+ . into_iter ( )
170+ . filter ( |v| regions. contains ( v) )
171+ . collect ( ) ,
162172 ipv4_capable : Some ( ts. ipv4_score > 10.0 ) ,
163173 ipv6_capable : Some ( ts. ipv6_score > 10.0 ) ,
164174 } )
You can’t perform that action at this time.
0 commit comments