@nxtedition/lib 23.3.21 → 23.3.23
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/package.json +1 -1
- package/trace.js +4 -4
package/package.json
CHANGED
package/trace.js
CHANGED
|
@@ -25,13 +25,14 @@ export function makeTrace({
|
|
|
25
25
|
|
|
26
26
|
const flushInterval = setInterval(flushTraces, 10e3)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
url = Array.isArray(url) ? url[0] : url
|
|
29
|
+
const client = new Pool(url, {
|
|
29
30
|
keepAliveTimeout: 10 * 60e3,
|
|
30
31
|
pipelining: 4,
|
|
31
32
|
connections: 4,
|
|
32
33
|
})
|
|
33
34
|
|
|
34
|
-
logger
|
|
35
|
+
logger.info({ url }, 'trace initialized')
|
|
35
36
|
|
|
36
37
|
destroyers?.push(async () => {
|
|
37
38
|
clearInterval(flushInterval)
|
|
@@ -52,8 +53,7 @@ export function makeTrace({
|
|
|
52
53
|
|
|
53
54
|
try {
|
|
54
55
|
pending += data.length
|
|
55
|
-
await request({
|
|
56
|
-
path: '/_bulk',
|
|
56
|
+
await request(new URL('/_bulk', url), {
|
|
57
57
|
method: 'POST',
|
|
58
58
|
idempotent: true,
|
|
59
59
|
headers: HEADERS,
|