From 9fd690c1ac7da6b19e9d3f680bed6b8bd5173d66 Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Tue, 17 Sep 2019 18:12:18 +0100 Subject: [PATCH] Update cache invalidation mechanism --- app/src/api/services/building.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/api/services/building.ts b/app/src/api/services/building.ts index 4d4befcc..f69586b7 100644 --- a/app/src/api/services/building.ts +++ b/app/src/api/services/building.ts @@ -3,7 +3,8 @@ * */ import db from '../../db'; -import { removeAllAtBbox } from '../../tiles/cache'; +import { tileCache } from '../../tiles/rendererDefinition'; +import { BoundingBox } from '../../tiles/types'; // data type note: PostgreSQL bigint (64-bit) is handled as string in JavaScript, because of // JavaScript numerics are 64-bit double, giving only partial coverage. @@ -314,8 +315,8 @@ function privateQueryBuildingBBOX(buildingId){ function expireBuildingTileCache(buildingId) { privateQueryBuildingBBOX(buildingId).then((bbox) => { - const buildingBbox = [bbox.xmax, bbox.ymax, bbox.xmin, bbox.ymin] - removeAllAtBbox(buildingBbox); + const buildingBbox: BoundingBox = [bbox.xmax, bbox.ymax, bbox.xmin, bbox.ymin]; + tileCache.removeAllAtBbox(buildingBbox); }) }