@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.mjs
CHANGED
|
@@ -36989,25 +36989,17 @@ var AuthHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
36989
36989
|
if (this.#accesssToken) return this.#accesssToken;
|
|
36990
36990
|
const lockKey = "GetAccessToken";
|
|
36991
36991
|
const lockTimeout = 6e4;
|
|
36992
|
-
if (this._lockHelper.GetOnHold(lockKey) === true) {
|
|
36993
|
-
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
this.
|
|
36998
|
-
|
|
36999
|
-
this.Debug(chalk.green(`GetAccessToken(): Getting existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37000
|
-
return this.#accesssToken;
|
|
37001
|
-
} else {
|
|
37002
|
-
this.Error(chalk.red(`GetAccessToken(): Could not get existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
37003
|
-
this.Error(chalk.red(`GetAccessToken(): continue anyway ...`));
|
|
37004
|
-
}
|
|
37005
|
-
} catch (error) {
|
|
37006
|
-
this.Error(chalk.red(`GetAccessToken(): Error: [${error}]`));
|
|
36992
|
+
if (this._lockHelper.GetOnHold(lockKey) === true) try {
|
|
36993
|
+
performance.now();
|
|
36994
|
+
await this._lockHelper.WaitOnHold(lockKey, lockTimeout);
|
|
36995
|
+
if (this.#accesssToken) return this.#accesssToken;
|
|
36996
|
+
else {
|
|
36997
|
+
this.Error(chalk.red(`GetAccessToken(): Could not get existing accesssToken (post hold release), lock key: [${lockKey}]`));
|
|
36998
|
+
this.Error(chalk.red(`GetAccessToken(): continue anyway ...`));
|
|
37007
36999
|
}
|
|
37000
|
+
} catch (error) {
|
|
37001
|
+
this.Error(chalk.red(`GetAccessToken(): Error: [${error}]`));
|
|
37008
37002
|
}
|
|
37009
|
-
this.Debug(chalk.yellow(`GetAccessToken(): accesssToken does not exist - setting up new accesssToken`));
|
|
37010
|
-
this.Debug(chalk.yellow(`GetAccessToken(): setting hold (lock), lock key: [${lockKey}]`));
|
|
37011
37003
|
this._lockHelper.SetOnHold(lockKey);
|
|
37012
37004
|
timeout = setTimeout(() => {
|
|
37013
37005
|
this.Warning(chalk.magenta(`GetAccessToken(): Timeout: [${this._authMaxTimeout}] exceeded for getting access token ...`));
|
|
@@ -37025,7 +37017,6 @@ var AuthHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
37025
37017
|
if (totalTime > this._authMaxTimeout) this.Warning(chalk.magenta(`GetAccessToken(): The total time for getting the access token: [${totalTime}]`));
|
|
37026
37018
|
this.#accesssToken = workingAaccesssToken;
|
|
37027
37019
|
this._lockHelper.ReleaseOnHold(lockKey);
|
|
37028
|
-
this.Debug(chalk.yellow(`GetAccessToken(): release hold (lock) Time taken for get access token: [${performance.now() - start}ms], lock key: [${lockKey}]`));
|
|
37029
37020
|
return this.#accesssToken;
|
|
37030
37021
|
} catch (error) {
|
|
37031
37022
|
if (timeout) clearTimeout(timeout);
|
|
@@ -37217,7 +37208,6 @@ var ClientHelper = class extends import_tiny_emitter.TinyEmitter {
|
|
|
37217
37208
|
stsfhirapiroot: fhirOptions.stsfhirapiroot,
|
|
37218
37209
|
stsfhirport: fhirOptions.stsfhirport,
|
|
37219
37210
|
logger: this._options.logger,
|
|
37220
|
-
agentManager: this.GetFhirAgentManager(),
|
|
37221
37211
|
onRetryAttempt
|
|
37222
37212
|
});
|
|
37223
37213
|
this.restFhirClient = fhirRESTClient;
|