Skip to content

Commit

Permalink
fix: fixed dependency bug & simplified TaskGraph
Browse files Browse the repository at this point in the history
Fixes #386.

This bug was fixed here as a side-effect of simplifying the
implementation of TaskGraph's dependency logic.

Previously, dependency relationships of nodes in TaskGraph were updated
by adding/removing from the dependencies/dependants arrays of the
appropriate TaskNodes when nodes were added or removed.

This logic was somewhat opaque and difficult to maintain/debug. Here, we
change the implementation to simply rebuild the dependency relationships
of all nodes in TaskGraph's index whenever a node is added or removed.

With this implementation, we no longer need to track dependants or handle
predecessors (since addTaskInternal and processTasksInternal are never
mutually concurrent), and the logic is hopefully simpler and easier to
maintain.
  • Loading branch information
thsig authored and edvald committed Dec 4, 2018
1 parent 53b6da1 commit 4a8428c
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 273 deletions.
2 changes: 1 addition & 1 deletion garden-service/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class DevCommand extends Command<Args, Opts> {
fromWatch: watch,
hotReloadServiceNames,
force: watch,
forceBuild: watch,
forceBuild: false,
includeDependants: watch,
}))
}
Expand Down
Loading

0 comments on commit 4a8428c

Please sign in to comment.