stream-json
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-10-14 00:06:47 +02:00
parent f85d17604b
commit 35f3097b8e

View File

@ -1,5 +1,3 @@
const nodeinfo = require('activitypub-express/pub/nodeinfo')
module.exports = (app, client) => { module.exports = (app, client) => {
const constant = require('./constant'), const constant = require('./constant'),
zlib = require('zlib'), zlib = require('zlib'),
@ -479,17 +477,17 @@ module.exports = (app, client) => {
}, { asStream: true, meta: false }), }, { asStream: true, meta: false }),
instancescomment = [], instancescomment = [],
block_count = 0, block_count = 0,
pipeline = chain([ pipeline = chain([
parser(), parser(),
pick({ filter: 'hits.hits' }), pick({ filter: 'hits.hits' }),
streamArray(), streamArray(),
data => { data => {
block_count++ block_count++
instancescomment.push({ instancescomment.push({
instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment instance: data.value._source.instance, comment: data.value._source.blocks.find(block => block.domain === clean(req.params.instance)).comment
}) })
} }
]) ])
result.pipe(pipeline) result.pipe(pipeline)
res.json({ res.json({
block_count, block_count,