Skip to content

Commit

Permalink
Merge pull request #1040 from multiversx/AddLogging
Browse files Browse the repository at this point in the history
Fix markeplace caching
  • Loading branch information
danielailie authored Oct 10, 2023
2 parents 4f3d467 + e63f9fc commit 49e51ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { CacheEventTypeEnum, ChangedEvent } from './events/changed.event';
import { MintersCachingService } from 'src/modules/minters/minters-caching.service';
import { MarketplacesCachingService } from 'src/modules/marketplaces/marketplaces-caching.service';
import { CampaignsCachingService } from 'src/modules/campaigns/campaigns-caching.service';
import { MarketplaceRedisHandler } from 'src/modules/marketplaces/loaders/marketplace.redis-handler';

@Injectable()
export class CacheEventsConsumer {
Expand All @@ -31,6 +32,7 @@ export class CacheEventsConsumer {
private collectionAssetsForOwnerRedisHandler: AssetsCollectionsForOwnerRedisHandler,
private cacheMintersService: MintersCachingService,
private cacheMarketplacesService: MarketplacesCachingService,
private marketplaceRedisHandler: MarketplaceRedisHandler,
private cacheCampaignsService: CampaignsCachingService,
private logger: Logger,
) {}
Expand Down Expand Up @@ -180,6 +182,7 @@ export class CacheEventsConsumer {

case CacheEventTypeEnum.Marketplaces:
const profileMarketplaces = new CpuProfiler();
if (event.id) await this.marketplaceRedisHandler.clearKey(event.id);
await this.cacheMarketplacesService.invalidateCache(event.id, event.extraInfo?.collection, event.address);
profileMarketplaces.stop('Marketplaces');
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { AssetsCollectionsForOwnerRedisHandler } from 'src/modules/assets/loader
import { MintersCachingService } from 'src/modules/minters/minters-caching.service';
import { MarketplacesCachingService } from 'src/modules/marketplaces/marketplaces-caching.service';
import { CampaignsCachingService } from 'src/modules/campaigns/campaigns-caching.service';
import { MarketplaceRedisHandler } from 'src/modules/marketplaces/loaders/marketplace.redis-handler';

@Module({
imports: [
Expand All @@ -39,6 +40,7 @@ import { CampaignsCachingService } from 'src/modules/campaigns/campaigns-caching
AssetsCollectionsForOwnerRedisHandler,
MintersCachingService,
MarketplacesCachingService,
MarketplaceRedisHandler,
CampaignsCachingService,
],
exports: [],
Expand Down

0 comments on commit 49e51ec

Please sign in to comment.