@cubejs-backend/shared
Advanced tools
Comparing version 0.25.22 to 0.25.29
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.25.29](https://github.com/cube-js/cube.js/compare/v0.25.28...v0.25.29) (2021-01-26) | ||
### Features | ||
* Improve logs for RefreshScheduler and too long execution ([d0f1f1b](https://github.com/cube-js/cube.js/commit/d0f1f1bbc32473452c763d22ff8ee728c74f6462)) | ||
## [0.25.22](https://github.com/cube-js/cube.js/compare/v0.25.21...v0.25.22) (2021-01-21) | ||
@@ -8,0 +19,0 @@ |
@@ -6,2 +6,3 @@ export { getEnv, isDockerImage } from './env'; | ||
export * from './promises'; | ||
export * from './convert'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./promises"), exports); | ||
__exportStar(require("./convert"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -23,3 +23,4 @@ export interface CancelablePromise<T> extends Promise<T> { | ||
interval: number; | ||
onDuplicatedExecution?: () => any; | ||
onDuplicatedStateResolved?: (intervalId: number, elapsedTime: number) => any; | ||
onDuplicatedExecution?: (intervalId: number) => any; | ||
}): CancelableInterval; | ||
@@ -26,0 +27,0 @@ interface RetryWithTimeoutOptions { |
@@ -68,6 +68,10 @@ "use strict"; | ||
let execution = null; | ||
let startTime = null; | ||
let intervalId = 0; | ||
let duplicatedExecutionTracked = true; | ||
const timeout = setInterval(async () => { | ||
if (execution) { | ||
if (options.onDuplicatedExecution) { | ||
options.onDuplicatedExecution(); | ||
duplicatedExecutionTracked = true; | ||
options.onDuplicatedExecution(intervalId); | ||
} | ||
@@ -77,2 +81,7 @@ return; | ||
try { | ||
intervalId++; | ||
if (intervalId >= Number.MAX_SAFE_INTEGER) { | ||
intervalId = 0; | ||
} | ||
startTime = Date.now(); | ||
execution = createCancelablePromise(fn); | ||
@@ -83,2 +92,6 @@ await execution; | ||
execution = null; | ||
if (duplicatedExecutionTracked && options.onDuplicatedStateResolved) { | ||
options.onDuplicatedStateResolved(intervalId, Date.now() - startTime); | ||
} | ||
duplicatedExecutionTracked = false; | ||
} | ||
@@ -85,0 +98,0 @@ }, options.interval); |
{ | ||
"name": "@cubejs-backend/shared", | ||
"version": "0.25.22", | ||
"version": "0.25.29", | ||
"description": "Shared code for Cube.js backend packages", | ||
@@ -45,3 +45,3 @@ "main": "dist/src/index.js", | ||
}, | ||
"gitHead": "7966d4abead09896fc24228ec3980608b7f07cd2" | ||
"gitHead": "849f3d8ed3f7d255c496a24870d5f477d0894764" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58346
32
578