Skip to content

Commit

Permalink
marklogic-community#169 added parameter for debug wait timeout.
Browse files Browse the repository at this point in the history
Can be set in gradle properties by specifying a value for mlDebugWaitTimeout
  • Loading branch information
peetkes committed Aug 11, 2023
1 parent 339ba91 commit 9be383a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ declare option xdmp:mapping "false";

(: Half a million lines of XQuery ought to be enough for any module. :)
declare variable $LIMIT as xs:integer := 654321 ;
declare variable $TIMEOUT := "%%mlDebugWaitTimeout%%";
declare variable $DEFAULT_TIMEOUT := 10;

declare private function cover:_put(
$map as map:map,
Expand Down Expand Up @@ -71,8 +73,8 @@ declare private function cover:_task-cancel-safe(
for $breakpoint in dbg:breakpoints($id)
return dbg:clear($id, $breakpoint),
dbg:detach($id),
if (fn:empty(dbg:wait($id, 10))) then
fn:error(xs:QName("FAILED-TO-CANCEL"), "unable to cancel a debugging request")
if (fn:empty(dbg:wait($id, if ($TIMEOUT eq "%%mlDebugWaitTimeout%%") then $DEFAULT_TIMEOUT else $TIMEOUT)))
then fn:error(xs:QName("FAILED-TO-CANCEL"), "unable to cancel a debugging request")
else ()
}
catch ($ex) {
Expand Down

0 comments on commit 9be383a

Please sign in to comment.