Skip to content

Commit cca5828

Browse files
authored
[ensure] Don't recompute environment if up to date (#1625)
## Summary This bug was introduced in #1584 and has at least 2 effects: * Perf regression (because we recompute environment all the time) * Plugins that create flakes may break if they create additional files in the same directory. (Another PR will address this issue in more depth) ## How was it tested? ```bash devbox add mysql80 devbox services up -b devbox services stop ```
1 parent a6e5c18 commit cca5828

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/impl/packages.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,12 @@ func (d *Devbox) ensurePackagesAreInstalled(ctx context.Context, mode installMod
228228
if err != nil {
229229
return err
230230
}
231-
// if mode is ensure and we are up to date, then we can skip the rest
232-
if mode == ensure && upToDate {
231+
232+
if mode == ensure {
233+
// if mode is ensure and we are up to date, then we can skip the rest
234+
if upToDate {
235+
return nil
236+
}
233237
fmt.Fprintln(d.stderr, "Ensuring packages are installed.")
234238
}
235239

0 commit comments

Comments
 (0)