Skip to content

Commit

Permalink
fix: ensure module is up to date in watch handler
Browse files Browse the repository at this point in the history
Before this fix, the module provided to the change handlers of
watch-mode commands didn't have an up-to-date version, reflecting the
latest dirty timestamp of the changed module.

This resulted in errors due to version discrepancies between e.g. build
and deploy tasks in watch mode commands.
  • Loading branch information
thsig committed Mar 4, 2019
1 parent e46de97 commit 44e8871
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion garden-service/src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ export async function processModules(
// Update the config graph
graph = await garden.getConfigGraph()

await Bluebird.map(changeHandler!(graph, changedModule), (task) => garden.addTask(task))
// Make sure the module's version is up to date.
const refreshedModule = await graph.getModule(changedModule.name)
modulesByName[event.name] = refreshedModule

await Bluebird.map(changeHandler!(graph, refreshedModule), (task) => garden.addTask(task))
await garden.processTasks()
})
})
Expand Down

0 comments on commit 44e8871

Please sign in to comment.