File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/main/kotlin/com/delphix/yamlparser Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,25 @@ class Runner (
5454 }
5555 }
5656
57+
58+ fun jobConflictExists (datapod : String ): Boolean {
59+ delphix.login(env[" delphixUser" ]? : " " , env[" delphixPass" ]? : " " )
60+ val container = delphix.selfServiceContainer().getRefByName(datapod)
61+ var jobs = delphix.job().getWhereRunning()
62+ for (job in jobs) {
63+ if (job.target == container.reference) return true
64+ }
65+ return false
66+ }
67+
68+
5769 fun execActionPhase (environment : Environment ) {
5870 for (action in environment.actions) {
5971 if (action.event == env[" gitEvent" ]) {
72+ while (jobConflictExists(environment.datapod)) {
73+ println (" Job Conflict Exists. Waiting 30 seconds to try again." )
74+ Thread .sleep(30000 )
75+ }
6076 callDelphix(environment.datapod, environment.name, action.action)
6177 outputStatus(environment.name, action.event, action.action)
6278 } else {
You can’t perform that action at this time.
0 commit comments