Skip to content

Commit

Permalink
fix: 修复下载队列调用函数上下文指定错误
Browse files Browse the repository at this point in the history
  • Loading branch information
ronggang committed Sep 4, 2019
1 parent 1c3477a commit a1a4909
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/background/downloadQuene.ts
Expand Up @@ -40,18 +40,19 @@ export default class DownloadQuene {

if (queue) {
this.isRunning = true;
console.log("downloadQueue", queue);
const timout = (this.service.options.batchDownloadInterval || 0) * 1000;

const sender = queue.clientId
? this.service.controller.sendTorrentToClient
: this.service.controller.sendTorrentToDefaultClient;

sender(queue)
sender
.call(this.service.controller, queue)
.then(() => {
this.successCount++;
})
.catch(error => {
console.log(error);
this.failedCount++;
})
.finally(() => {
Expand Down

0 comments on commit a1a4909

Please sign in to comment.