solver: solve synchronously

This forces Solve() to be synchronous and ensures operations don't get
discarded because of optimizations.

Improves fix for #14

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-01-15 14:17:33 -08:00
parent 9a9e3b629f
commit e090f657bb
3 changed files with 13 additions and 6 deletions

View File

@@ -57,7 +57,10 @@ func (c *Component) Compute(ctx context.Context, s Solver, out Fillable) (FS, er
if err != nil {
return fs, err
}
_, err = fs.ReadDir(ctx, "/")
// Force a `Solve()` in case it hasn't been called earlier.
// If the FS is already solved, this is a noop.
_, err = fs.Solve(ctx)
return fs, err
}