@nsshunt/ststestrunner 1.1.46 → 1.1.47

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.
@@ -29,6 +29,8 @@ var TestCaseFhirBase = class {
29
29
  #publishTelemetryTimeout = null;
30
30
  #publishTelemetryTimeoutVal = 1e3;
31
31
  #originRegex = /^(api:\/\/\w+)/;
32
+ #resetSocketClientTrigger = 100;
33
+ #clientSocketFetchCount = 0;
32
34
  #authAgentManager;
33
35
  accessTokenTime = performance.now();
34
36
  newTokenLimitTime = 30;
@@ -130,7 +132,15 @@ var TestCaseFhirBase = class {
130
132
  };
131
133
  GetFhirSocketClient = async () => {
132
134
  try {
133
- if (this.fhirClient) return this.fhirClient;
135
+ this.#clientSocketFetchCount++;
136
+ if (this.fhirClient) {
137
+ if (this.#clientSocketFetchCount % this.#resetSocketClientTrigger === 0) {
138
+ this.fhirClient.ResetSocket();
139
+ await Sleep(250);
140
+ this.fhirClient = null;
141
+ return this.GetFhirSocketClient();
142
+ }
143
+ }
134
144
  const fhirOptions = this.#options.fhirOptions;
135
145
  const options = {
136
146
  fhirServerEndpoint: fhirOptions.stsfhirserverendpoint,
@@ -143,7 +153,7 @@ var TestCaseFhirBase = class {
143
153
  agentManager: this.GetFhirAgentManager(),
144
154
  joinRooms: [],
145
155
  logger: this.#runnerExecutionWorker.logger,
146
- authToken: await this.GetAccessTokenForSocketClientAccess(),
156
+ GetConnectionAccessToken: this.GetAccessTokenForSocketClientAccess,
147
157
  GetAccessToken: this.GetAccessToken
148
158
  };
149
159
  if (this.runner.options.fhirOptions.stsfhirsocketclientmode === "socket-client-all-in-one") this.fhirClient = new FhirSocketClientAllInOne("FhirSocketClient", options);