expired ids should reject instead of returning null
This commit is contained in:
parent
0761fcf902
commit
15ac0e1d49
2 changed files with 8 additions and 9 deletions
|
@ -90,11 +90,10 @@ function ttl(id) {
|
|||
function filename(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
redis_client.hget(id, 'filename', (err, reply) => {
|
||||
if (!err) {
|
||||
resolve(reply);
|
||||
} else {
|
||||
reject(err);
|
||||
if (err || !reply) {
|
||||
return reject();
|
||||
}
|
||||
resolve(reply);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue