mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
sample: simulate timeout to demonstrate caching
This commit is contained in:
@@ -5,7 +5,10 @@ import { Controller, Get, UseInterceptors } from '@nestjs/common';
|
||||
@UseInterceptors(CacheInterceptor)
|
||||
export class AppController {
|
||||
@Get()
|
||||
findAll() {
|
||||
async findAll() {
|
||||
// For demonstration purposes, we will simulate a delay
|
||||
// to show that the cache is working as expected.
|
||||
await new Promise(resolve => setTimeout(resolve, 3000));
|
||||
return [{ id: 1, name: 'Nest' }];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user