Как избежать превышения тайм-аута CORB при запуске большого пакета данных, превышающего 10 миллионов документов pdf / xml? Нужно ли уменьшать количество потоков и размер пакета.
uris-модуль:
let $uris := cts:uris(
(),
(),
cts:and-query((
cts:collection-query("/sites"),
cts:field-range-query("cdate","<","2019-10-01"),
cts:not-query(
cts:or-query((
cts:field-word-query("dcax","200"),
more code...,
))
)
))
return (fn:count($uris), $uris)
process.xqy :
declare variable $URI as xs:string external;
let $uris := fn:tokenize($URI,";")
let $outputJson := "/output/json/"
let $outputPdf := "/output/pdf/"
for $uri1 in $uris
let $accStr := fn:substring-before(fn:substring-after($uri1,"/sites/"),".xml")
let $pdfUri := fn:concat("/pdf/iadb/",$accStr,".pdf")
let $doc := fn:doc($uri1)
let $obj := json:object()
let $_ := map:put($obj,"PaginationOrMediaCount",fn:number($doc/rec/MediaCount))
let $_ := map:put($obj,"Abstract",fn:replace($doc/rec/Abstract/text(),"[^a-zA-Z0-9 ,.\-\r\n]",""))
let $_ := map:put($obj,"Descriptors",json:to-array($doc/rec/Descriptor/text()))
let $_ := map:put($obj,"FullText",fn:replace($doc/rec/FullText/text(),"[^a-zA-Z0-9 ,.\-\r\n]",""))
let $_ := xdmp:save(
fn:concat($outputJson,$accStr,".json"),
xdmp:to-json($obj)
)
let $_ := if (fn:doc-available($pdfUri))
then xdmp:save(
fn:concat($outputPdf,$accStr,".pdf"),
fn:doc($pdfUri)
)
else ()
return $URI