Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 5e2595a

Browse files
authored
Merge pull request #8 from rundeck-plugins/bootstrap-error
Delay initialization until rundeck has bootstrapped
2 parents 7a3b254 + be51ef2 commit 5e2595a

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

rundeck-execution-mode-timer/grails-app/init/com/rundeck/plugin/BootStrap.groovy

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,4 @@ package com.rundeck.plugin
22

33
class BootStrap {
44

5-
def executionModeService
6-
def updateModeProjectService
7-
8-
9-
def timer(String name,Closure clos){
10-
long bstart=System.currentTimeMillis()
11-
log.debug("BEGIN: ${name}")
12-
def res=clos()
13-
log.debug("${name} in ${System.currentTimeMillis()-bstart}ms")
14-
return res
15-
}
16-
17-
def init = { servletContext ->
18-
19-
timer("executionModeService.init") {
20-
executionModeService.initProcess()
21-
}
22-
23-
timer("updateModeProjectService.init") {
24-
updateModeProjectService.initProcess()
25-
}
26-
27-
28-
}
29-
def destroy = {
30-
}
315
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.rundeck.plugin
2+
3+
import grails.events.annotation.Subscriber
4+
5+
class BootStrapService {
6+
7+
def executionModeService
8+
def updateModeProjectService
9+
10+
def timer(String name,Closure clos){
11+
long bstart=System.currentTimeMillis()
12+
log.debug("BEGIN: ${name}")
13+
def res=clos()
14+
log.debug("${name} in ${System.currentTimeMillis()-bstart}ms")
15+
return res
16+
}
17+
18+
@Subscriber("rundeck.bootstrap")
19+
void init() {
20+
timer("executionModeService.init") {
21+
executionModeService.initProcess()
22+
}
23+
24+
timer("updateModeProjectService.init") {
25+
updateModeProjectService.initProcess()
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)