aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--global-functions17
1 files changed, 13 insertions, 4 deletions
diff --git a/global-functions b/global-functions
index f5682be..ce538f3 100644
--- a/global-functions
+++ b/global-functions
@@ -945,18 +945,26 @@
:global ScriptLockOrder;
- :local Count 0;
:foreach Id,Ticket in=($ScriptLockOrder->$Script) do={
:if (($ScriptLockOrder->$Script->$Id) = $Remove) do={
:set ($ScriptLockOrder->$Script->$Id);
}
+ }
+ }
- :if ([ :typeof ($ScriptLockOrder->$Script->$Id) ] != "nothing") do={
- :set Count ($Count + 1);
+ :local CleanupTickets do={
+ :local Script [ :tostr $1 ];
+
+ :global ScriptLockOrder;
+
+ :local Clean true;
+ :foreach Ticket in=($ScriptLockOrder->$Script) do={
+ :if ([ :typeof $Ticket ] != "nothing") do={
+ :set Clean false;
}
}
- :if ($Count = 0) do={
+ :if ($Clean = true) do={
:set ($ScriptLockOrder->$Script) [ :toarray "" ];
}
}
@@ -986,6 +994,7 @@
:if ([ $IsFirstTicket $Script $MyTicket ] = true && [ $TicketCount $Script ] = [ $JobCount $Script ]) do={
$RemoveTicket $Script $MyTicket;
+ $CleanupTickets $Script;
:return false;
}