import { inject , lifeCycleObserver , LifeCycleObserver } from '@loopback/core' ; import { CachingService } from '../caching-service' ; import { CACHING_SERVICE } from '../keys' ; /**
 * This class will be bound to the application as a `LifeCycleObserver` during
 * `boot`
 */ @ lifeCycleObserver ( 'caching' ) export class CacheObserver implements LifeCycleObserver { private timer : NodeJS . Timer ; constructor ( @ inject ( CACHING_SERVICE ) private cachingService ) { } /**
     * This method will be invoked when the application starts
     */ async start ( ) { await this . cachingService . start ( ) ; } /**
     * This method will be invoked when the application stops
     */ async stop ( ) { await this . cachingService . stop ( ) ; } }