@nsshunt/ststestrunner 1.1.139 → 1.1.140

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.
@@ -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
- this.Debug(chalk.default.magenta(`GetAccessToken(): accesssToken does not exist - some other client setting up the new accesssToken (on hold/lock), lock key: [${lockKey}] - waiting ...`));
36999
- try {
37000
- const miniStart = performance.now();
37001
- await this._lockHelper.WaitOnHold(lockKey, lockTimeout);
37002
- this.Debug(chalk.default.yellow(`GetAccessToken(): hold (lock) released after: [${performance.now() - miniStart}ms], lock key: [${lockKey}]`));
37003
- if (this.#accesssToken) {
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);