aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-05 16:12:36 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commit1e8918fdaa5a30393e2004d1f5e4dff458936b67 (patch)
tree9448ec9ff079f6f6c083f68fb4d8e53167bede51 /global-functions.rsc
parent56e97dd60c3c9603df07bb315587c44da1ff44fd (diff)
global-functions: $ScriptLock: do not exit from global function
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc9
1 files changed, 4 insertions, 5 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index b68fbaa..1e36616 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -1170,8 +1170,7 @@
# lock script against multiple invocation
:set ScriptLock do={
:local Script [ :tostr $1 ];
- :local DoReturn $2;
- :local WaitMax ([ :tonum $3 ] * 10);
+ :local WaitMax ([ :tonum $3 ] * 10);
:global GetRandom20CharAlNum;
:global IfThenElse;
@@ -1286,13 +1285,13 @@
:if ([ $IsFirstTicket $Script $MyTicket ] = true && [ $TicketCount $Script ] = [ $JobCount $Script ]) do={
$RemoveTicket $Script $MyTicket;
$CleanupTickets $Script;
- :return false;
+ :return true;
}
$RemoveTicket $Script $MyTicket;
$LogPrintExit2 info $0 ("Script '" . $Script . "' started more than once" . [ $IfThenElse ($WaitCount > 0) \
- " and timed out waiting for lock" "" ] . "... Aborting.") [ $IfThenElse ($DoReturn = true) false true ];
- :return true;
+ " and timed out waiting for lock" "" ] . "... Aborting.") false;
+ :return false;
}
# send notification via NotificationFunctions - expects at least two string arguments