Skip to content

Commit

Permalink
Fix request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
johackim committed Jun 28, 2016
1 parent 6820aab commit 7b03c29
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"apiBaseUrl": "https://api.real-debrid.com",
"apiEndpoint": "https://api.real-debrid.com/rest/1.0",
"clientId": "MPCF6OE5DLDM2",
"requestDelay": 2000
"requestDelay": 5000
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"chalk": "^1.1.3",
"co": "^4.6.0",
"co-prompt": "^1.0.0",
"co-sleep": "0.0.1",
"commander": "^2.9.0",
"config": "git+https://github.com/jcherqui/node-config",
"debug": "^2.2.0",
Expand Down
3 changes: 3 additions & 0 deletions src/torrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import config from 'config';
import debug from 'debug';
import fs from 'fs';
import ora from 'ora';
import sleep from 'co-sleep';

const log = debug('torrent');

Expand Down Expand Up @@ -119,6 +120,7 @@ export function * convertMagnet(magnet, token) {
link = infos.links;
progressConvert = Number(infos.progress);
spinner.text = `Convert magnet progress: ${progressConvert}% (${status})`;
yield sleep(config.requestDelay);
}
spinner.stop();

Expand All @@ -141,6 +143,7 @@ export function * convertTorrent(torrent, token) {
link = infos.links;
progressConvert = Number(infos.progress);
spinner.text = `Convert torrent progress: ${progressConvert}% (${status})`;
yield sleep(config.requestDelay);
}
spinner.stop();

Expand Down

0 comments on commit 7b03c29

Please sign in to comment.