Commit 8f6270ad authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

hotfix: timeout at uni-goettingen.de

parents 7d23ba24 d94aab47
project.name=http://textgrid.de/ns/SADE-fontane-develop project.name=http://textgrid.de/ns/SADE-fontane-develop
project.version=5.1.0 project.version=5.1.1
project.title=[Fontane] SADE project.title=[Fontane] SADE
project.abbrev=SADE-fontane-develop project.abbrev=SADE-fontane-develop
project.processorversion=5.2.0 project.processorversion=5.2.0
......
...@@ -29,8 +29,15 @@ declare function app:project-id($node as node(), $model as map(*)) { ...@@ -29,8 +29,15 @@ declare function app:project-id($node as node(), $model as map(*)) {
: @param $model a map containing arbitrary data - used to pass information between template calls : @param $model a map containing arbitrary data - used to pass information between template calls
:) :)
declare function app:publications($node as node(), $model as map(*)) { declare function app:publications($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/publikationen/303721.html" /> let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/publikationen/303721.html"
let $response := hc:send-request($request)[2] timeout="3"/>
let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
return return
($response//*:li[@class="content"])[position() lt 5] ($response//*:li[@class="content"])[position() lt 5]
}; };
...@@ -43,8 +50,14 @@ declare function app:publications($node as node(), $model as map(*)) { ...@@ -43,8 +50,14 @@ declare function app:publications($node as node(), $model as map(*)) {
: @param $model a map containing arbitrary data - used to pass information between template calls : @param $model a map containing arbitrary data - used to pass information between template calls
:) :)
declare function app:presentations($node as node(), $model as map(*)) { declare function app:presentations($node as node(), $model as map(*)) {
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/vortr%C3%A4ge-und-pr%C3%A4sentationen/303717.html" /> let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/vortr%C3%A4ge-und-pr%C3%A4sentationen/303717.html" timeout="3"/>
let $response := hc:send-request($request)[2] let $response :=
try {
hc:send-request($request)[2]
} catch * {
(: inject information that we cannot read from remote. :)
<node><li class="content">Host "uni-goettingen.de" timed out after 3s.</li></node>
}
for $item in ($response//*:li[@class="content"])[position() lt 5] for $item in ($response//*:li[@class="content"])[position() lt 5]
return return
element li { for $i in $item/node() return local:nodeTest($i) } element li { for $i in $item/node() return local:nodeTest($i) }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment