Skip to content

Commit

Permalink
Completed some pending to-do's (minor improvements).
Browse files Browse the repository at this point in the history
  • Loading branch information
danielduarte committed Aug 29, 2019
1 parent a4460bb commit b5e866e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/engine/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export class Flow {
}

protected setExpectedResults(expectedResults: string[] = []) {

// Check expected results that cannot be fulfilled
// @todo make this configurable (throw or not throw an error)
const missingExpected = expectedResults.filter(r => !this.taskProvisions.includes(r));
if (missingExpected.length > 0) {
const msg = `Warning: The results [${missingExpected.join(', ')}] are not provided by any task`;
Expand Down Expand Up @@ -209,8 +209,6 @@ export class Flow {
}

protected initRunStatus() {
// @todo Avoid initializing twice.

this.state = FlowReady.getInstance();

this.runStatus = new FlowRunStatus();
Expand Down
4 changes: 0 additions & 4 deletions src/engine/task-types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @todo Check if this is needed
import { Task } from './task';

export interface TaskMap {
Expand All @@ -12,9 +11,6 @@ export interface TaskRunStatus {
[name: string]: any;
};

// @todo Check if this is needed
pendingResults: string[];

solvedResults: {
[name: string]: any;
};
Expand Down
10 changes: 1 addition & 9 deletions src/engine/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ export class Task {

protected spec: TaskSpec;

protected runStatus: TaskRunStatus;
protected runStatus!: TaskRunStatus;

public constructor(code: string, spec: TaskSpec) {
this.code = code;
this.spec = spec;
this.runStatus = {
pendingReqs: [],
solvedReqs: {},
pendingResults: [],
solvedResults: {},
};

this.parseSpec();
}
Expand All @@ -35,11 +29,9 @@ export class Task {
}

public resetRunStatus() {
// @todo Avoid initializing twice.
this.runStatus = {
pendingReqs: [...this.spec.requires],
solvedReqs: {},
pendingResults: [...this.spec.provides],
solvedResults: {},
};
}
Expand Down

0 comments on commit b5e866e

Please sign in to comment.