()
| 156 | } |
| 157 | |
| 158 | private async executeGraph() { |
| 159 | const timer = Timer.start(this.runResult.timing); |
| 160 | |
| 161 | this.runResult.status = dataform.RunResult.ExecutionStatus.RUNNING; |
| 162 | this.runResult.timing = timer.current(); |
| 163 | this.notifyListeners(); |
| 164 | |
| 165 | // If we're not resuming an existing run, prepare schemas. |
| 166 | if (this.runResult.actions.length === 0) { |
| 167 | await this.prepareAllSchemas(); |
| 168 | } |
| 169 | |
| 170 | // Recursively execute all actions as they become executable. |
| 171 | await this.executeAllActionsReadyForExecution(); |
| 172 | |
| 173 | if (this.stopped) { |
| 174 | return this.runResult; |
| 175 | } |
| 176 | |
| 177 | this.runResult.timing = timer.end(); |
| 178 | |
| 179 | this.runResult.status = dataform.RunResult.ExecutionStatus.SUCCESSFUL; |
| 180 | if (this.timedOut) { |
| 181 | this.runResult.status = dataform.RunResult.ExecutionStatus.TIMED_OUT; |
| 182 | } else if (this.cancelled) { |
| 183 | this.runResult.status = dataform.RunResult.ExecutionStatus.CANCELLED; |
| 184 | } else if ( |
| 185 | this.runResult.actions.some( |
| 186 | action => action.status === dataform.ActionResult.ExecutionStatus.FAILED |
| 187 | ) |
| 188 | ) { |
| 189 | this.runResult.status = dataform.RunResult.ExecutionStatus.FAILED; |
| 190 | } |
| 191 | |
| 192 | return this.runResult; |
| 193 | } |
| 194 | |
| 195 | private async prepareAllSchemas() { |
| 196 | // Work out all the schemas we are going to need to create first. |
no test coverage detected