-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Just made some changes on getTargets() to update to fast api V2, replaced the "while contents" with this
while (targets.length < this.urlCount) {
/* eslint-disable no-await-in-loop */
const { response } = await this.get(`http${this.https ? 's' : ''}://api.fast.com/netflix/speedtest/v2?https=${this.https ? 'true' : 'false'}&token=${this.token}&urlCount=${this.urlCount - targets.length}`);
/* eslint-enable no-await-in-loop */
if (response.statusCode !== 200) {
if (response.statusCode === 403) {
throw new ApiError({ code: ApiError.CODES.BAD_TOKEN });
}
throw new ApiError({ code: ApiError.CODES.UNKNOWN });
}
targets.push(...response.data.targets);
}Metadata
Metadata
Assignees
Labels
No labels