Update cache invalidation mechanism

This commit is contained in:
Maciej Ziarkowski 2019-09-17 18:12:18 +01:00
parent 5adb8e6146
commit 9fd690c1ac

View File

@ -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);
})
}