delay capture because font isn't loading
This commit is contained in:
parent
8b88462591
commit
075d147f63
|
@ -324,6 +324,12 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
highlight: {
|
||||
fields: {
|
||||
title: { number_of_fragments: 0, pre_tags: ['***'], post_tags: ['***'] },
|
||||
text: { number_of_fragments: 0, pre_tags: ['***'], post_tags: ['***'] }
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -335,7 +341,18 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
const items = sitems.body.hits.hits.map(e => e._source)
|
||||
// return highlights
|
||||
const items = sitems.body.hits.hits.map(e => {
|
||||
const item = e._source
|
||||
if (e.highlight?.title) {
|
||||
item.title = e.highlight.title[0]
|
||||
}
|
||||
if (e.highlight?.text) {
|
||||
item.text = e.highlight.text[0]
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
return {
|
||||
cursor: items.length === LIMIT ? nextCursorEncoded(decodedCursor) : null,
|
||||
items
|
||||
|
|
|
@ -4,7 +4,7 @@ const Pageres = require('pageres')
|
|||
|
||||
async function captureUrl () {
|
||||
try {
|
||||
const streams = await new Pageres({ crop: true, scale: 2, timeout: 10, launchOptions: { args: ['--single-process'] } })
|
||||
const streams = await new Pageres({ crop: true, delay: 1, scale: 2, timeout: 10, launchOptions: { args: ['--single-process'] } })
|
||||
.src(process.argv[2], ['600x315'])
|
||||
.run()
|
||||
process.stdout.write(streams[0], () => process.exit(0))
|
||||
|
|
Loading…
Reference in New Issue