diff --git a/src/app/backend-selection.service.ts b/src/app/backend-selection.service.ts index 6af57f0cf1162207c71fe70c2574c505efbcb2e2..7c3fb7bf8c8b6354beaea3ecf455ad21532df1e9 100644 --- a/src/app/backend-selection.service.ts +++ b/src/app/backend-selection.service.ts @@ -29,11 +29,12 @@ export class BackendSelectionService { var obs: Observable<any>[] = []; let headers = new HttpHeaders(); let options = { headers: headers, withCredentials: false}; + console.log('entering testAPIServers'); for (let server of servers) { //obs.push( this.http.get(s.tes+'/sshagent',options).pipe(map((r) => {return {'server':s,'check':r}}))); obs.push( this.http.get<string>(server.tes+'/sshagent',options).pipe( timeout(2000), - catchError(e=> {return of(null)}), + catchError(e=> {console.error('testing api server',server); console.error(e); return of(null)}), map((v) => {return {'server':server,'query':v}}), )); } @@ -97,6 +98,7 @@ export class BackendSelectionService { let options = { headers: headers, withCredentials: false}; this.http.get<APIServer[]>('./assets/config/apiservers.json',options).pipe( switchMap((v) => this.testApiServers(v)), + tap((v) => console.log('testapiservers observable fired',v)), map((list, idx) => (<any[]>list) .filter(function (v) { return v.query != null}) .map(function (v) {return v.server})) // Note the two maps are not the same one is an rxjs observable map one is a list map