DEV Community

Discussion on: How to add cache to your GCP Cloud functions in JavaScript

Collapse
 
alex_elesus profile image
Alex Sevostjanov

Nice solution.
It seems you have a typo in this code:
const dateInOneHour = new Date()
ttl.setHours(ttl.getHours() + 1);
cache.ttl = dateInOneHour

Should not it be:
const dateInOneHour = new Date()
dateInOneHour.setHours(dateInOneHour.getHours() + 1);
cache.ttl = dateInOneHour

Collapse
 
yvonnickfrin profile image
🦁 Yvonnick FRIN

Thank you Alex! I corrected it 👍