Skip to content

Commit

Permalink
fix(log): fetching error (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexist committed May 23, 2022
1 parent 96c21ef commit c10f1e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/services/karma-host-resolver.ts
Expand Up @@ -7,19 +7,22 @@ export class KarmaHostResolver implements IKarmaHostResolver {

const resolvers = ips.map(ip => {
const karmaClientUrl = `http://${ip}:${port}/context.json`;
console.log('NSUTR: fetching ' + karmaClientUrl);
console.log(`NSUTR: fetching ${karmaClientUrl}`);

return this.http.getString({
url: karmaClientUrl,
method: 'GET',
timeout: 3000,
}).then(() => {
console.log('NSUTR: found karma at ' + ip);
console.log(`NSUTR: found karma at ${ip}`);
if (!foundKarma) {
foundKarma = true;
resolve(ip);
}
}, () => undefined)
}, (err) => {
console.log(`NSUTR: error fetching ${karmaClientUrl}`, err);
return undefined;
})
});

Promise.all(resolvers)
Expand Down

0 comments on commit c10f1e4

Please sign in to comment.