Skip to content

Commit

Permalink
fix: skip build task during hot-reloading
Browse files Browse the repository at this point in the history
Previously, the module being hot-reloaded was rebuilt following the hot
reload operation.

This is an unnecessary step, and is removed in this commit to reduce CPU
load.
  • Loading branch information
thsig committed Nov 14, 2018
1 parent be8fed2 commit 5e24716
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions garden-service/src/tasks/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import * as Bluebird from "bluebird"
import { flatten } from "lodash"
import { computeAutoReloadDependants, withDependants } from "../watch"
import { DeployTask } from "./deploy"
import { BuildTask } from "./build"
import { getNames } from "../util/util"
import { Garden } from "../garden"
import { Module } from "../types/module"
Expand All @@ -29,15 +28,11 @@ export async function getTasksForHotReload(
await computeAutoReloadDependants(garden)))
.filter(m => !hotReloadModuleNames.has(m.name))

const buildTask = new BuildTask({ garden, module, force: true })

const deployTasks = (await servicesForModules(garden, modulesForDeployment, serviceNames))
return (await servicesForModules(garden, modulesForDeployment, serviceNames))
.map(service => new DeployTask({
garden, service, force: true, forceBuild: true, watch: true, hotReloadServiceNames,
}))

return [buildTask, ...deployTasks]

}

export async function getHotReloadModuleNames(garden: Garden, hotReloadServiceNames: string[]): Promise<Set<string>> {
Expand Down

0 comments on commit 5e24716

Please sign in to comment.