Commit 88b1aa48 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

fix timeout at uni-goettingen.de

parent 7d23ba24
......@@ -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
:)
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 $response := hc:send-request($request)[2]
let $request := <hc:request method="get" href="https://www.uni-goettingen.de/de/publikationen/303721.html"
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
($response//*:li[@class="content"])[position() lt 5]
};
......@@ -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
:)
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 $response := hc:send-request($request)[2]
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 :=
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]
return
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