Skip to content

Commit

Permalink
Return null in case of expired cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Shweelan Samson authored and zaidka committed Aug 19, 2019
1 parent 17889cf commit fd34dd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function get(key): Promise<any> {
} else {
const res = await mongoCollection.findOne({ _id: { $in: [key] } });
if (res && res["expire"] > expire) return res["value"];
return res;
return null;
}
}

Expand Down

0 comments on commit fd34dd8

Please sign in to comment.