@nsshunt/ststestrunner 1.1.139 → 1.1.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ststestrunner.cjs
CHANGED
|
@@ -36994,25 +36994,17 @@ var AuthHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
36994
36994
|
if (this.#accesssToken) return this.#accesssToken;
|
|
36995
36995
|
const lockKey = "GetAccessToken";
|
|
36996
36996
|
const lockTimeout = 6e4;
|
|
36997
|
-
if (this._lockHelper.GetOnHold(lockKey) === true) {
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
this.
|
|
37003
|
-
|
|
37004
|
-
this.Debug(chalk.default.green(`GetAccessToken(): Getting existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37005
|
-
return this.#accesssToken;
|
|
37006
|
-
} else {
|
|
37007
|
-
this.Error(chalk.default.red(`GetAccessToken(): Could not get existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37008
|
-
this.Error(chalk.default.red(`GetAccessToken(): continue anyway ...`));
|
|
37009
|
-
}
|
|
37010
|
-
} catch (error) {
|
|
37011
|
-
this.Error(chalk.default.red(`GetAccessToken(): Error: [${error}]`));
|
|
36997
|
+
if (this._lockHelper.GetOnHold(lockKey) === true) try {
|
|
36998
|
+
performance.now();
|
|
36999
|
+
await this._lockHelper.WaitOnHold(lockKey, lockTimeout);
|
|
37000
|
+
if (this.#accesssToken) return this.#accesssToken;
|
|
37001
|
+
else {
|
|
37002
|
+
this.Error(chalk.default.red(`GetAccessToken(): Could not get existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37003
|
+
this.Error(chalk.default.red(`GetAccessToken(): continue anyway ...`));
|
|
37012
37004
|
}
|
|
37005
|
+
} catch (error) {
|
|
37006
|
+
this.Error(chalk.default.red(`GetAccessToken(): Error: [${error}]`));
|
|
37013
37007
|
}
|
|
37014
|
-
this.Debug(chalk.default.yellow(`GetAccessToken(): accesssToken does not exist - setting up new accesssToken`));
|
|
37015
|
-
this.Debug(chalk.default.yellow(`GetAccessToken(): setting hold (lock), lock key: [${lockKey}]`));
|
|
37016
37008
|
this._lockHelper.SetOnHold(lockKey);
|
|
37017
37009
|
timeout = setTimeout(() => {
|
|
37018
37010
|
this.Warning(chalk.default.magenta(`GetAccessToken(): Timeout: [${this._authMaxTimeout}] exceeded for getting access token ...`));
|
|
@@ -37030,7 +37022,6 @@ var AuthHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
37030
37022
|
if (totalTime > this._authMaxTimeout) this.Warning(chalk.default.magenta(`GetAccessToken(): The total time for getting the access token: [${totalTime}]`));
|
|
37031
37023
|
this.#accesssToken = workingAaccesssToken;
|
|
37032
37024
|
this._lockHelper.ReleaseOnHold(lockKey);
|
|
37033
|
-
this.Debug(chalk.default.yellow(`GetAccessToken(): release hold (lock) Time taken for get access token: [${performance.now() - start}ms], lock key: [${lockKey}]`));
|
|
37034
37025
|
return this.#accesssToken;
|
|
37035
37026
|
} catch (error) {
|
|
37036
37027
|
if (timeout) clearTimeout(timeout);
|
|
@@ -37222,7 +37213,6 @@ var ClientHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
37222
37213
|
stsfhirapiroot: fhirOptions.stsfhirapiroot,
|
|
37223
37214
|
stsfhirport: fhirOptions.stsfhirport,
|
|
37224
37215
|
logger: this._options.logger,
|
|
37225
|
-
agentManager: this.GetFhirAgentManager(),
|
|
37226
37216
|
onRetryAttempt
|
|
37227
37217
|
});
|
|
37228
37218
|
this.restFhirClient = fhirRESTClient;
|