Skip to content

Commit

Permalink
feat(flight-crawler): update message (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored Dec 20, 2022
2 parents b20992b + 1d3275c commit 2df579f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 6 additions & 1 deletion core/fetch/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ async function _handleCacheStrategy(options: Required<FetchOptions>): Promise<Re
case 'cache_only': {
const cachedResponse = await cacheStorage.match(request);
if (cachedResponse == null) {
logger.error('_handleCacheStrategy', 'fetch_cache_not_found', {request});
logger.accident(
'_handleCacheStrategy',
'fetch_cache_not_found',
'cacheStorage is cache_only but no cache found',
{url: request.url},
);
throw new Error('fetch_cache_not_found');
}
// else
Expand Down
2 changes: 1 addition & 1 deletion core/signal/src/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class SignalInterface<SignalName extends keyof AlwatrSignals> {
const nextSignalValuePromise = this.getNextSignalValue();
_dispatchSignal(
this._requestSignal,
requestParam as unknown as AlwatrSignals[SignalName], // mastmalize to avoid type error
requestParam as unknown as AlwatrSignals[SignalName], // mastmalize to avoid type error
);
return nextSignalValuePromise;
}
Expand Down
4 changes: 1 addition & 3 deletions services/flight-crawler/src/crawl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ function makeMessage(job: Job): string {
// prettier-ignore
const resultListStr = job.resultList.length === 0 ? 'هیچ پروازی یافت نشد!'
: job.resultList.map((jobResult) => `
قیمت: ${jobResult.price.toLocaleString('en-US')}
ساعت: ${jobResult.time}
هواپیمایی ${jobResult.airline}
💰${jobResult.price.toLocaleString('en-US')}${jobResult.time} 💺${jobResult.seatCount} 🛫${jobResult.flightId}
`).join('');

return `
Expand Down

0 comments on commit 2df579f

Please sign in to comment.