@nxtedition/lib 21.5.9 → 21.5.11
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/app.js +1 -5
- package/couch.js +1 -0
- package/http.js +1 -1
- package/logger.js +3 -2
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -604,11 +604,7 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
604
604
|
? rxjs.timer(0, 10e3).pipe(
|
|
605
605
|
rx.exhaustMap(async () => {
|
|
606
606
|
try {
|
|
607
|
-
|
|
608
|
-
await couch.up()
|
|
609
|
-
} catch {
|
|
610
|
-
await couch.info()
|
|
611
|
-
}
|
|
607
|
+
await couch.up()
|
|
612
608
|
return [
|
|
613
609
|
{
|
|
614
610
|
id: 'app:couch',
|
package/couch.js
CHANGED
|
@@ -118,6 +118,7 @@ export function makeCouch(opts) {
|
|
|
118
118
|
* @param {function} [options.retry=null] - The function to retry the request on error.
|
|
119
119
|
* @param {string} [options.since=null] - The sequence number to start from.
|
|
120
120
|
* @param {number} [options.highWaterMark=128 * 1024] - Buffering.
|
|
121
|
+
* @param {object} [options.selector=null] - The selector to filter changes.
|
|
121
122
|
* @yields {Array<{ id: string, seq?: string, doc?: Object, deleted?: boolean, changes: Array<{ rev: string }> }>}
|
|
122
123
|
*/
|
|
123
124
|
async function* changes({ client = defaultClient, signal = null, logger, ...options } = {}) {
|
package/http.js
CHANGED
|
@@ -49,7 +49,7 @@ export class Context {
|
|
|
49
49
|
assert(logger)
|
|
50
50
|
|
|
51
51
|
this.#id = req.headers['request-id'] || req.headers['Request-Id'] || genReqId()
|
|
52
|
-
this.#
|
|
52
|
+
this.#userAgent = req.headers['user-agent'] || req.headers['User-Agent'] || ''
|
|
53
53
|
this.#req = req
|
|
54
54
|
this.#res = res
|
|
55
55
|
this.#logger = logger.child({ reqId: this.#id, url: req.url, userAgent: this.#userAgent })
|
package/logger.js
CHANGED
|
@@ -25,9 +25,10 @@ export function createLogger(
|
|
|
25
25
|
} else if (!isProduction) {
|
|
26
26
|
stream = pino.destination({ fd: process.stdout.fd ?? 1, sync: true })
|
|
27
27
|
} else if (!isMainThread) {
|
|
28
|
-
|
|
28
|
+
// TODO (perf): Async mode doesn't work super well in workers.
|
|
29
|
+
stream = pino.destination({ fd: 1, sync: true })
|
|
29
30
|
} else {
|
|
30
|
-
stream = pino.destination({ sync: false, minLength:
|
|
31
|
+
stream = pino.destination({ sync: false, minLength: 4 * 1024, maxWrite: 32 * 1024 })
|
|
31
32
|
|
|
32
33
|
let flushing = 0
|
|
33
34
|
setInterval(() => {
|