@tramvai/module-cache-warmup 4.26.1 → 4.26.2

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/utils.es.js CHANGED
@@ -1,8 +1,18 @@
1
+ import http from 'http';
2
+ import https from 'https';
1
3
  import { format } from '@tinkoff/url';
2
4
  import requestFactory from '@tinkoff/request-core';
3
- import http from '@tinkoff/request-plugin-protocol-http';
5
+ import httpPlugin from '@tinkoff/request-plugin-protocol-http';
4
6
 
5
- const request = requestFactory([http()]);
7
+ const agentOptions = {
8
+ keepAlive: true,
9
+ scheduling: 'lifo',
10
+ };
11
+ const agent = {
12
+ http: new http.Agent(agentOptions),
13
+ https: new https.Agent(agentOptions),
14
+ };
15
+ const request = requestFactory([httpPlugin({ agent })]);
6
16
  async function queueRequests(options) {
7
17
  const { maxSimultaneous = 2, makeRequest, requestsOptions } = options;
8
18
  const req = async (option) => {
package/lib/utils.js CHANGED
@@ -2,16 +2,28 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var http = require('http');
6
+ var https = require('https');
5
7
  var url = require('@tinkoff/url');
6
8
  var requestFactory = require('@tinkoff/request-core');
7
- var http = require('@tinkoff/request-plugin-protocol-http');
9
+ var httpPlugin = require('@tinkoff/request-plugin-protocol-http');
8
10
 
9
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
12
 
11
- var requestFactory__default = /*#__PURE__*/_interopDefaultLegacy(requestFactory);
12
13
  var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
14
+ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
15
+ var requestFactory__default = /*#__PURE__*/_interopDefaultLegacy(requestFactory);
16
+ var httpPlugin__default = /*#__PURE__*/_interopDefaultLegacy(httpPlugin);
13
17
 
14
- const request = requestFactory__default["default"]([http__default["default"]()]);
18
+ const agentOptions = {
19
+ keepAlive: true,
20
+ scheduling: 'lifo',
21
+ };
22
+ const agent = {
23
+ http: new http__default["default"].Agent(agentOptions),
24
+ https: new https__default["default"].Agent(agentOptions),
25
+ };
26
+ const request = requestFactory__default["default"]([httpPlugin__default["default"]({ agent })]);
15
27
  async function queueRequests(options) {
16
28
  const { maxSimultaneous = 2, makeRequest, requestsOptions } = options;
17
29
  const req = async (option) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-cache-warmup",
3
- "version": "4.26.1",
3
+ "version": "4.26.2",
4
4
  "description": "tramvai cache warmup module",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -24,10 +24,10 @@
24
24
  "@tinkoff/url": "0.10.1"
25
25
  },
26
26
  "peerDependencies": {
27
- "@tramvai/core": "4.26.1",
28
- "@tramvai/module-common": "4.26.1",
29
- "@tramvai/state": "4.26.1",
30
- "@tramvai/tokens-http-client": "4.26.1",
27
+ "@tramvai/core": "4.26.2",
28
+ "@tramvai/module-common": "4.26.2",
29
+ "@tramvai/state": "4.26.2",
30
+ "@tramvai/tokens-http-client": "4.26.2",
31
31
  "tslib": "^2.4.0"
32
32
  },
33
33
  "module": "lib/server.es.js",