Return null in case of expired cache

This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2019-08-19 15:28:46 -07:00
1 parent 17889cf41c
commit fd34dd8839
1 file changed
+1 -1
+1 -1
View File
@@ -62,7 +62,7 @@ export async function get(key): Promise<any> {
} else { } else {
const res = await mongoCollection.findOne({ _id: { $in: [key] } }); const res = await mongoCollection.findOne({ _id: { $in: [key] } });
if (res && res["expire"] > expire) return res["value"]; if (res && res["expire"] > expire) return res["value"];
return res; return null;
} }
} }