Skip to content

Commit

Permalink
fix: fixing the cache purge (#3878)
Browse files Browse the repository at this point in the history
  • Loading branch information
YazeedLoonat authored Feb 8, 2024
1 parent 09ba64b commit 04b0c16
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions api/src/services/listing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1286,19 +1286,23 @@ export class ListingService implements OnModuleInit {
this.httpService.request({
baseURL: process.env.PROXY_URL,
method: 'PURGE',
url: shouldPurgeAllListings
? '/listings?*'
: `/listings/${savedResponseId}*`,
url: `/listings/${savedResponseId}*`,
}),
undefined,
).catch((e) =>
console.error(
shouldPurgeAllListings
? 'purge all listings error = '
: `purge listing ${savedResponseId} error = `,
e,
),
console.error(`purge listing ${savedResponseId} error = `, e),
);

if (shouldPurgeAllListings) {
await firstValueFrom(
this.httpService.request({
baseURL: process.env.PROXY_URL,
method: 'PURGE',
url: '/listings?*',
}),
undefined,
).catch((e) => console.error('purge all listings error = ', e));
}
}

/*
Expand Down

0 comments on commit 04b0c16

Please sign in to comment.