Skip to content

Commit 45eebe2

Browse files
author
nalexand
committed
fixed task
1 parent ba22b0c commit 45eebe2

File tree

2 files changed

+67
-9
lines changed

2 files changed

+67
-9
lines changed

cls/kutac/monitor/utils/Installer.cls.xml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<Export generator="Cache" version="25" zv="Cache for Windows (x86-32) 2015.1 (Build 429U)" ts="2015-07-24 16:07:29">
2+
<Export generator="Cache" version="25" zv="Cache for Windows (x86-32) 2015.1 (Build 429U)" ts="2015-07-28 15:22:47">
33
<Class name="kutac.monitor.utils.Installer">
4-
<TimeChanged>63757,58028.937681</TimeChanged>
4+
<TimeChanged>63761,55214.468859</TimeChanged>
55
<TimeCreated>63732,50627.865496</TimeCreated>
66

77
<XData name="Install">
@@ -19,7 +19,7 @@
1919
<Database Name="${Namespace}" Dir="${MGRDIR}/${Namespace}" Create="yes" MountRequired="true" Resource="%DB_${Namespace}" PublicPermissions="RW" MountAtStartup="true"/>
2020
</Configuration>
2121
<Log Text="Creating web application /csp/${Namespace}" Level="0"/>
22-
<CSPApplication Url='#{$ZCONVERT("/csp/${Namespace}", "L")}' Directory="#{##class(%DeepSee.Report.UI.reportModelServer).GetCSPDirectory()}/${Namespace}" AuthenticationMethods="64" IsNamespaceDefault="true" />
22+
<CSPApplication Url='#{$ZCONVERT("/csp/${Namespace}", "L")}' Directory='#{##class(%DeepSee.Report.UI.reportModelServer).GetCSPDirectory()_$ZCONVERT("${Namespace}", "L")}' AuthenticationMethods="64" IsNamespaceDefault="true" />
2323
<RunInstall Class="kutac.monitor.utils.Installer" Method="EnableDeepSee"/>
2424
</Namespace>
2525
<Log Text="End Creating namespace ${Namespace} and web application /csp/${Namespace}" Level="0"/>
@@ -44,7 +44,7 @@
4444
4545
<Log Text="Mapping kutac package to choosed namespace" Level="0"/>
4646
<Namespace Name="${Namespace}" Create="no">
47-
<ClassMapping From="${Namespace}" Package="kutac"/>
47+
<ClassMapping From="${Namespace}" Package="kutac.*"/>
4848
</Namespace>
4949
5050
@@ -100,7 +100,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
100100
<Implementation><![CDATA[
101101
Set Namespace=tInstaller.Evaluate("${Namespace}")
102102
Do tInstaller.PushNS("%SYS")
103-
Set tSC = ..Update(Namespace, "intersystems-ru", "deepsee-sysmon-dashboards", "master")
103+
Set tSC = ..Update(Namespace, "alexandrov-nikita", "deepsee-sysmon-dashboards", "master")
104104
Do tInstaller.PopNS()
105105
If $$$ISERR(tSC) Throw ##class(%Installer.Exception).CreateFromStatus(tSC)
106106
quit $$$OK
@@ -109,7 +109,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
109109

110110
<Method name="Update">
111111
<ClassMethod>1</ClassMethod>
112-
<FormalSpec>Namespace=$Namespace,Owner:%String="intersystems-ru",Repository:%String="deepsee-sysmon-dashboards",Branch:%String,Username:%String,Password:%String</FormalSpec>
112+
<FormalSpec>Namespace=$Namespace,Owner:%String="alexandrov-nikita",Repository:%String="deepsee-sysmon-dashboards",Branch:%String,Username:%String="alexandrov-nikita",Password:%String="lolipops561azaza"</FormalSpec>
113113
<ReturnType>%Status</ReturnType>
114114
<Implementation><![CDATA[
115115
Set namespace = $Namespace
@@ -228,7 +228,7 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
228228
write !, "Creating Task"
229229
Do tInstaller.PopNS()
230230
Do tInstaller.PushNS(Namespace)
231-
set st4 = ..CreateTask()
231+
set st4 = ..CreateTask(Namespace)
232232
Do tInstaller.PopNS()
233233
set st = $$$ADDSC(st4, $$$ADDSC(st1, $$$ADDSC(st2, st3)))
234234
if $$$ISERR(st) Throw ##class(%Installer.Exception).CreateFromStatus(st)
@@ -313,11 +313,36 @@ do ##class(kutac.monitor.utils.Installer).setup(.pVars)</Description>
313313

314314
<Method name="CreateTask">
315315
<ClassMethod>1</ClassMethod>
316-
<FormalSpec>hrs:%Integer=3</FormalSpec>
316+
<FormalSpec>Namespace=$Namespace,min:%Integer=90</FormalSpec>
317317
<ReturnType>%Status</ReturnType>
318318
<Implementation><![CDATA[
319319
320-
q ##class(%DeepSee.CubeManager.Task.Synch).Schedule(0, 1, 1, hrs, ($p($H, ",", 2) + 60) # 10800, 0)
320+
//q ##class(%DeepSee.CubeManager.Task.Synch).Schedule(0, 1, 1, hrs, ($p($H, ",", 2) + 60) # 10800, 0)
321+
//q ##class(%DeepSee.CubeManager.Task.Build).Schedule(0, 0, 1, "", ($p($H, ",", 2) + 10))
322+
Set task=##class(%SYS.Task).%New()
323+
Set task.Name = "Build cubes in "_Namespace
324+
Set task.NameSpace= Namespace
325+
Set task.TimePeriod=0 // Daily
326+
Set task.TimePeriodEvery=1 // Every 1 day
327+
Set task.DailyFrequency=1 // Run Several times in a day
328+
Set task.DailyFrequencyTime=0 // Run every x minutes
329+
Set task.DailyIncrement=min // # of minutes between runs
330+
Set task.DailyStartTime = 0 // Start at 00:00:00
331+
Set task.DailyEndTime = 86399 // End at 23:59:59
332+
Set task.StartDate = $p($H,",",1) // Start today
333+
334+
335+
Set taskdef = ##class(kutac.monitor.utils.Task).%New()
336+
Set taskdef.Namespace = Namespace
337+
Do task.AssignSettings(taskdef)
338+
Set task.TaskClass=$classname(taskdef)
339+
340+
Set st = task.%Save()
341+
Return:$$$ISERR(st) st
342+
Set id = task.%Id()
343+
Return ##class(%SYS.Task).RunNow(id)
344+
345+
// Do ##class(%DeepSee.Utils).%BuildCube("CacheGitHubCICube",1,0)
321346
]]></Implementation>
322347
</Method>
323348
</Class>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Export generator="Cache" version="25" zv="Cache for Windows (x86-32) 2015.1 (Build 429U)" ts="2015-07-28 15:23:21">
3+
<Class name="kutac.monitor.utils.Task">
4+
<Description>
5+
Simple update task. Use CacheGitHubCI.Hook if you need more functionality.</Description>
6+
<Super>%SYS.Task.Definition</Super>
7+
<TimeChanged>63761,55062.906473</TimeChanged>
8+
<TimeCreated>63761,54770.687029</TimeCreated>
9+
10+
<Parameter name="TaskName">
11+
<Default>CubesBuildTask</Default>
12+
</Parameter>
13+
14+
<Property name="Namespace">
15+
<Description>
16+
Namespace, where to download and compile repository</Description>
17+
<Type>%String</Type>
18+
<InitialExpression>$Namespace</InitialExpression>
19+
</Property>
20+
21+
<Method name="OnTask">
22+
<ReturnType>%Status</ReturnType>
23+
<Implementation><![CDATA[
24+
do ##class(%DeepSee.Utils).%BuildCube("HistoryPerfData")
25+
do ##class(%DeepSee.Utils).%BuildCube("CurrentSysDataDB")
26+
do ##class(%DeepSee.Utils).%BuildCube("HistoryPerfDataWD")
27+
do ##class(%DeepSee.Utils).%BuildCube("HistorySysData")
28+
do ##class(%DeepSee.Utils).%BuildCube("HistorySysDataDB")
29+
q $$$OK
30+
]]></Implementation>
31+
</Method>
32+
</Class>
33+
</Export>

0 commit comments

Comments
 (0)