Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(purge-expired): Promise.delay takes milliseconds; allow subsecond…
Browse files Browse the repository at this point in the history
… delay
  • Loading branch information
jrgm committed Sep 12, 2016
1 parent 80c360e commit 10c6103
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/purge_expired_tokens.js
Expand Up @@ -47,7 +47,7 @@ if (!program.pocketId) {
}

const numberOfTokens = parseInt(program.tokenCount) || 200;
const delaySeconds = parseInt(program.delaySeconds) || 1; // Default 1 seconds
const delaySeconds = Number(program.delaySeconds) || 1; // Default 1 seconds
const ignorePocketClientId = program.pocketId;

db.ping().done(function() {
Expand Down
2 changes: 1 addition & 1 deletion lib/db/mysql/index.js
Expand Up @@ -560,7 +560,7 @@ MysqlStore.prototype = {

deletedItems = deletedItems + res.affectedRows;

return P.delay(delaySeconds)
return P.delay(delaySeconds * 1000)
.then(function () {
return promiseWhile();
});
Expand Down

0 comments on commit 10c6103

Please sign in to comment.