diff --git a/package.json b/package.json index 2d13e13c1bd02..ea192b226a3eb 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "@typescript-eslint/eslint-plugin": "^4.17.0", "core-js": "^3.6.5", "lerna": "^3.13.1", + "patch-package": "^6.4.7", "ramda": "^0.27.0", "rollup-plugin-dts": "^1.1.8", - "patch-package": "^6.4.7", "whatwg-fetch": "^3.0.0" }, "files": [ diff --git a/packages/cubejs-cubestore-driver/src/CubeStoreCacheDriver.ts b/packages/cubejs-cubestore-driver/src/CubeStoreCacheDriver.ts index 377d375f991d7..46f216c9d8d7e 100644 --- a/packages/cubejs-cubestore-driver/src/CubeStoreCacheDriver.ts +++ b/packages/cubejs-cubestore-driver/src/CubeStoreCacheDriver.ts @@ -24,6 +24,10 @@ export class CubeStoreCacheDriver implements CacheDriverInterface { const rows = await this.connection.query(`CACHE SET NX TTL ${expiration} ? ?`, [key, '1']); if (rows && rows.length === 1 && rows[0]?.success === 'true') { + if (tkn.isCanceled()) { + return false; + } + try { await tkn.with(cb()); } finally { diff --git a/packages/cubejs-query-orchestrator/src/orchestrator/RedisCacheDriver.ts b/packages/cubejs-query-orchestrator/src/orchestrator/RedisCacheDriver.ts index 17039ad0659c0..4586ea626aa84 100644 --- a/packages/cubejs-query-orchestrator/src/orchestrator/RedisCacheDriver.ts +++ b/packages/cubejs-query-orchestrator/src/orchestrator/RedisCacheDriver.ts @@ -52,6 +52,10 @@ export class RedisCacheDriver implements CacheDriverInterface { ); if (response === 'OK') { + if (tkn.isCanceled()) { + return false; + } + try { await tkn.with(cb()); } finally {