Skip to content

Commit

Permalink
enable delete in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
bahalool committed Jan 6, 2019
1 parent 3142fd1 commit a75f8d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ class RedisAdapter {
if (!path.startsWith('/')) {
path = pathLib.join('/', path);
}
return client.del(path);
const jobIds = await this.list(options);
const keysToDelete = jobIds.map(x => ['del', x.path]);
return new Promise((resolve, reject) => {
client.multi(keysToDelete).exec().then(data => resolve(data), error => reject(error));
});
}

_set(options) {
Expand Down

0 comments on commit a75f8d6

Please sign in to comment.