From eeb398546717250cb4d06ffa1f075363cbf25ecd Mon Sep 17 00:00:00 2001 From: Sergey Mikhaylenko Date: Thu, 4 Jan 2024 10:27:01 +0300 Subject: [PATCH 1/3] Update task.cls --- src/dc/cron/task.cls | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dc/cron/task.cls b/src/dc/cron/task.cls index e82a08c..e785bc3 100644 --- a/src/dc/cron/task.cls +++ b/src/dc/cron/task.cls @@ -151,7 +151,9 @@ ClassMethod ProcessCronMakerExpression(cronMakerExpression As %String, ByRef tas } } - + else { + Set taskProperties("DailyStartTime")=$p($H,",",2)+1 + } If month = "*" { If dom = "?" { From ebe9c94003a6df00095c6c31da6d655b518b34d1 Mon Sep 17 00:00:00 2001 From: Sergey Mikhaylenko Date: Mon, 8 Jan 2024 19:33:48 +0300 Subject: [PATCH 2/3] Update task.cls --- src/dc/cron/task.cls | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/dc/cron/task.cls b/src/dc/cron/task.cls index e785bc3..ea82253 100644 --- a/src/dc/cron/task.cls +++ b/src/dc/cron/task.cls @@ -5,7 +5,6 @@ Class dc.cron.task /// cron expression for schedule /// runcode - a string with ObjectScript you want to be executed - it will be xecuted /// tid - the taskid to be returned. You need it e.g. to suspend/resume or kill the task - ClassMethod Start(name, cron, runcode, runnow = 1, ByRef tid) As %Status { set sc = $$$OK @@ -16,7 +15,6 @@ ClassMethod Start(name, cron, runcode, runnow = 1, ByRef tid) As %Status /// * * * * * - run every minute /// 0 * * * * - run every hour /// 0 0 * * * - run every day at midnight - ClassMethod StartOld(cron, runcode, runnow = 1, ByRef tid) As %Status { set sc = $$$OK @@ -82,7 +80,9 @@ ClassMethod StartByCronMakerExpression(name As %String, cronMakerExpression As % Quit:key="" Set $PROPERTY(task,key) = keyValue } - + zw properties + zw task + Set taskdef = ##class(%SYS.Task.RunLegacyTask).%New() Set task.TaskClass=$classname(taskdef) set taskdef.ExecuteCode=runcode @@ -122,7 +122,9 @@ ClassMethod ProcessCronMakerExpression(cronMakerExpression As %String, ByRef tas Set taskProperties("DailyFrequency")=1 } } - + else { + Set taskProperties("StartDate") = $p($H,",",1)+1 + } If hours '= "*" { Set everyXHours = $Piece(hours,"/",2) If everyXHours '= "" { @@ -152,8 +154,9 @@ ClassMethod ProcessCronMakerExpression(cronMakerExpression As %String, ByRef tas } else { - Set taskProperties("DailyStartTime")=$p($H,",",2)+1 + Set taskProperties("StartDate") = $p($H,",",1)+1 } + If month = "*" { If dom = "?" { @@ -186,8 +189,8 @@ ClassMethod ProcessCronMakerExpression(cronMakerExpression As %String, ByRef tas Set taskProperties("TimePeriodDay") = $Piece(dow,"#",2)_"^"_$LISTFIND(lstD,$Piece(dow,"#",1)) } } - - Quit $$$OK + + Quit $$$OK } ClassMethod Kill(tid As %Integer) As %Status From 14216abfb8838657ab0b42261792d0e0b43332d2 Mon Sep 17 00:00:00 2001 From: Sergey Mikhaylenko Date: Mon, 8 Jan 2024 19:38:16 +0300 Subject: [PATCH 3/3] Update task.cls --- src/dc/cron/task.cls | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/dc/cron/task.cls b/src/dc/cron/task.cls index ea82253..a04a729 100644 --- a/src/dc/cron/task.cls +++ b/src/dc/cron/task.cls @@ -80,8 +80,6 @@ ClassMethod StartByCronMakerExpression(name As %String, cronMakerExpression As % Quit:key="" Set $PROPERTY(task,key) = keyValue } - zw properties - zw task Set taskdef = ##class(%SYS.Task.RunLegacyTask).%New() Set task.TaskClass=$classname(taskdef)