Skip to content

Commit

Permalink
remove local cache
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Oct 12, 2023
1 parent 53ca70e commit 75b2992
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/marketplaces/marketplaces-caching.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Injectable } from '@nestjs/common';
import '../../utils/extensions';
import { Constants } from '@multiversx/sdk-nestjs-common';
import { CacheService } from '@multiversx/sdk-nestjs-cache';
import { RedisCacheService } from '@multiversx/sdk-nestjs-cache';
import { CollectionType } from '../assets/models/Collection.type';
import { CacheInfo } from 'src/common/services/caching/entities/cache.info';
import { Marketplace } from './models';

@Injectable()
export class MarketplacesCachingService {
constructor(private cacheService: CacheService) {}
constructor(private cacheService: RedisCacheService) {}

Check warning on line 11 in src/modules/marketplaces/marketplaces-caching.service.ts

View check run for this annotation

Codecov / codecov/patch

src/modules/marketplaces/marketplaces-caching.service.ts#L11

Added line #L11 was not covered by tests

public async getAllMarketplaces(getMarketplaces: () => any): Promise<CollectionType<Marketplace>> {
return await this.cacheService.getOrSet(CacheInfo.AllMarketplaces.key, () => getMarketplaces(), Constants.oneHour());
Expand Down Expand Up @@ -57,10 +57,12 @@ export class MarketplacesCachingService {
}

private async invalidateMarketplaceByCollection(key: string) {
console.log({ key: `${CacheInfo.MarketplaceCollection.key}_${key}` });
await this.cacheService.delete(`${CacheInfo.MarketplaceCollection.key}_${key}`);

Check warning on line 61 in src/modules/marketplaces/marketplaces-caching.service.ts

View check run for this annotation

Codecov / codecov/patch

src/modules/marketplaces/marketplaces-caching.service.ts#L60-L61

Added lines #L60 - L61 were not covered by tests
}

private async invalidateMarketplaceByAddressAndCollection(key: string) {
console.log({ key: `${CacheInfo.MarketplaceCollection.key}_${key}` });
await this.cacheService.delete(`${CacheInfo.MarketplaceAddressCollection.key}_${key}`);

Check warning on line 66 in src/modules/marketplaces/marketplaces-caching.service.ts

View check run for this annotation

Codecov / codecov/patch

src/modules/marketplaces/marketplaces-caching.service.ts#L65-L66

Added lines #L65 - L66 were not covered by tests
}
}

0 comments on commit 75b2992

Please sign in to comment.