Skip to content

Commit d5e3060

Browse files
committed
chore: let's use decorator
1 parent 043bb98 commit d5e3060

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import crypto from 'crypto';
22
import csvWriter from 'csv-write-stream';
33
import { LRUCache } from 'lru-cache';
44
import { pipeline } from 'stream';
5-
import { asyncDebounce, getEnv, MaybeCancelablePromise, streamToArray } from '@cubejs-backend/shared';
5+
import { AsyncDebounce, getEnv, MaybeCancelablePromise, streamToArray } from '@cubejs-backend/shared';
66
import { CubeStoreCacheDriver, CubeStoreDriver } from '@cubejs-backend/cubestore-driver';
77
import {
88
BaseDriver,
@@ -811,7 +811,8 @@ export class QueryCache {
811811
return cacheKeyQueries.map((q) => this.loadRefreshKey(q, expireSecs, options));
812812
}
813813

814-
public loadRefreshKey = asyncDebounce(async (q: QueryWithParams, expireSecs: number, options: LoadRefreshKeyOptions) => {
814+
@AsyncDebounce()
815+
public async loadRefreshKey(q: QueryWithParams, expireSecs: number, options: LoadRefreshKeyOptions) {
815816
const [query, values, queryOptions]: QueryWithParams = Array.isArray(q) ? q : [q, [], {}];
816817

817818
return this.cacheQueryResult(
@@ -829,7 +830,7 @@ export class QueryCache {
829830
external: queryOptions?.external,
830831
},
831832
);
832-
});
833+
}
833834

834835
public withLock = <T = any>(
835836
key: string,

packages/cubejs-query-orchestrator/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
"strictFunctionTypes": false,
1515
"strictBindCallApply": false,
1616
"strictPropertyInitialization": false,
17+
"experimentalDecorators": true
1718
},
1819
}

tsconfig.base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"esModuleInterop": true,
4040
"allowSyntheticDefaultImports": true,
4141
"skipLibCheck": true,
42-
"forceConsistentCasingInFileNames": true
42+
"forceConsistentCasingInFileNames": true,
43+
"experimentalDecorators": true
4344
}
4445
}

0 commit comments

Comments
 (0)