Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
huihuimoe committed May 9, 2022
1 parent df5ab01 commit f89b3be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export default class Bootstrap {
fs.closeSync(fs.openSync(this.logFile, 'a'))
}

public async fetchTorrentsStatus() {
const urls = Array.isArray(this.config.url) ? this.config.url : [this.config.url]
public async fetchTorrentsStatus(specUrls?: string[]) {
const urls = specUrls ?? (Array.isArray(this.config.url) ? this.config.url : [this.config.url])
const responses = await Promise.all(urls.map(url => this.httpClient.get<string>(url)))
const torrentsStatusQueue = responses.map(async response => {
const DOMTree = new JSDOM(response.data)
Expand Down
3 changes: 1 addition & 2 deletions libs/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export function createRetry(times = 3, delay = 1000) {
fn().then(resolve).catch((e) => {
if (--times) setTimeout(retry, delay)
else reject(e)
}
)
})
}
retry()
})
Expand Down

0 comments on commit f89b3be

Please sign in to comment.