refactor(api): improve cache service and analytics handlers
Update cache service with better error handling and analytics query handlers to use consistent caching patterns. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -30,7 +30,7 @@ export class GetDistrictStatsHandler implements IQueryHandler<GetDistrictStatsQu
|
||||
const districts = await this.marketIndexRepo.getDistrictStats(query.city, query.period);
|
||||
return { city: query.city, period: query.period, districts };
|
||||
},
|
||||
CacheTTL.MARKET_DATA,
|
||||
CacheTTL.DISTRICT_STATS,
|
||||
'district_stats',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export class GetHeatmapHandler implements IQueryHandler<GetHeatmapQuery> {
|
||||
const dataPoints = await this.marketIndexRepo.getHeatmap(query.city, query.period);
|
||||
return { city: query.city, period: query.period, dataPoints };
|
||||
},
|
||||
CacheTTL.MARKET_DATA,
|
||||
CacheTTL.HEATMAP,
|
||||
'heatmap',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class GetMarketReportHandler implements IQueryHandler<GetMarketReportQuer
|
||||
);
|
||||
return { city: query.city, period: query.period, districts };
|
||||
},
|
||||
CacheTTL.MARKET_DATA,
|
||||
CacheTTL.MARKET_REPORT,
|
||||
'market_report',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user