Skip to content

Commit 3546826

Browse files
authored
fix(sandbox): fix cache sandbox (#2232)
gh-00
1 parent 70bcdff commit 3546826

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

sandbox/cache-example/src/application.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
RestExplorerComponent,
1212
} from '@loopback/rest-explorer';
1313
import {ServiceMixin} from '@loopback/service-proxy';
14-
import {CachePluginComponent} from '@sourceloop/cache';
14+
import {CachingComponent} from '@sourceloop/cache';
1515
import path from 'path';
1616
import {MySequence} from './sequence';
1717

@@ -35,7 +35,7 @@ export class CacheExampleApplication extends BootMixin(
3535
});
3636
this.component(RestExplorerComponent);
3737

38-
this.component(CachePluginComponent);
38+
this.component(CachingComponent);
3939

4040
this.projectRoot = __dirname;
4141
// Customize @loopback/boot Booter Conventions here

sandbox/cache-example/src/repositories/product.repository.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44
// https://opensource.org/licenses/MIT
55
import {Constructor, Getter, inject} from '@loopback/core';
66
import {DefaultCrudRepository} from '@loopback/repository';
7-
import {CacheManager} from '@sourceloop/cache';
7+
import {CacheMixin} from '@sourceloop/cache';
88
import {CacheDbDataSource, DbDataSource} from '../datasources';
99
import {Product} from '../models';
1010

11-
export class ProductRepository extends CacheManager.CacheRepositoryMixin<
11+
export class ProductRepository extends CacheMixin<
1212
Product,
1313
typeof Product.prototype.id,
1414
{},
1515
Constructor<DefaultCrudRepository<Product, typeof Product.prototype.id, {}>>
16-
>(DefaultCrudRepository, {
17-
prefix: 'product',
18-
ttl: 50000,
19-
}) {
16+
>(DefaultCrudRepository) {
2017
redisDataSource: CacheDbDataSource;
2118
constructor(
2219
@inject('datasources.db') readonly dataSource: DbDataSource,

0 commit comments

Comments
 (0)