@opentap/runner-client 2.3.4 → 2.3.5-alpha.1.1
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/lib/BaseClient.js +5 -4
- package/package.json +1 -1
package/lib/BaseClient.js
CHANGED
|
@@ -110,11 +110,11 @@ var BaseClient = /** @class */ (function () {
|
|
|
110
110
|
* @returns Promise of an object
|
|
111
111
|
*/
|
|
112
112
|
BaseClient.prototype.request = function (subject, payload, options) {
|
|
113
|
-
var _a, _b
|
|
113
|
+
var _a, _b;
|
|
114
114
|
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
-
var data, headers, timeout, replySubject, chunkSize, requestId, opts, fileDescriptor, chunkNumber, getChunk, subscription, responsePromise, chunk, i;
|
|
115
|
+
var data, headers, timeout, replySubject, serverMaxPayload, chunkSize, requestId, opts, fileDescriptor, chunkNumber, getChunk, subscription, responsePromise, chunk, i;
|
|
116
116
|
var _this = this;
|
|
117
|
-
return __generator(this, function (
|
|
117
|
+
return __generator(this, function (_c) {
|
|
118
118
|
// Prepend the base subject if the given subject does not start with that
|
|
119
119
|
if (!(options === null || options === void 0 ? void 0 : options.fullSubject)) {
|
|
120
120
|
subject = "".concat(this.baseSubject, ".Request.").concat(subject);
|
|
@@ -127,7 +127,8 @@ var BaseClient = /** @class */ (function () {
|
|
|
127
127
|
headers = this.buildHeaders();
|
|
128
128
|
timeout = (options === null || options === void 0 ? void 0 : options.timeout) || this.timeout;
|
|
129
129
|
replySubject = uuidv4();
|
|
130
|
-
|
|
130
|
+
serverMaxPayload = (_b = (_a = this.connection) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.max_payload;
|
|
131
|
+
chunkSize = serverMaxPayload ? serverMaxPayload - 50000 : 512000;
|
|
131
132
|
// The Session and the Client need to agree on the chunk size. Put it in a header.
|
|
132
133
|
headers.append('ChunkSize', chunkSize.toString());
|
|
133
134
|
requestId = uuidv4();
|