Skip to content

Instantly share code, notes, and snippets.

@sunnyy02
Last active April 2, 2022 04:47
Show Gist options
  • Save sunnyy02/e1538e8f6c10cf120f9374e469d5bc27 to your computer and use it in GitHub Desktop.
Save sunnyy02/e1538e8f6c10cf120f9374e469d5bc27 to your computer and use it in GitHub Desktop.
const value = await this.cacheManager.get('test-key');
if (!value) {
const response = await this.getHello();
this.cacheManager.set(
'test-key',
response,
{ ttl: 0 },
);
return response;
}
return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment