Skip to content

Commit 3445b4f

Browse files
committed
chore: re-enable terraform caching
why was this disabled???
1 parent b5ad628 commit 3445b4f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

cli/server.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
243243
notifyCtx, notifyStop := signal.NotifyContext(ctx, InterruptSignals...)
244244
defer notifyStop()
245245

246-
// Ensure we have a unique cache directory for this process.
247-
cacheDir := filepath.Join(cfg.CacheDir.String(), uuid.NewString())
246+
cacheDir := cfg.CacheDir.String()
248247
err = os.MkdirAll(cacheDir, 0o700)
249248
if err != nil {
250249
return xerrors.Errorf("create cache directory: %w", err)
251250
}
252-
defer os.RemoveAll(cacheDir)
253251

254252
// Clean up idle connections at the end, e.g.
255253
// embedded-postgres can leave an idle connection

coderd/coderd.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"crypto/tls"
66
"crypto/x509"
77
"encoding/json"
8+
"flag"
89
"fmt"
910
"io"
1011
"net/http"
@@ -878,7 +879,12 @@ func (api *API) Close() error {
878879
}
879880

880881
func compressHandler(h http.Handler) http.Handler {
881-
cmp := middleware.NewCompressor(5,
882+
level := 5
883+
if flag.Lookup("test.v") != nil {
884+
level = 1
885+
}
886+
887+
cmp := middleware.NewCompressor(level,
882888
"text/*",
883889
"application/*",
884890
"image/*",

provisioner/terraform/install.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func Install(ctx context.Context, log slog.Logger, dir string, wantVersion *vers
6262
log.Debug(
6363
ctx,
6464
"installing terraform",
65+
slog.F("prev_version", hasVersion),
6566
slog.F("dir", dir),
6667
slog.F("version", TerraformVersion),
6768
)

0 commit comments

Comments
 (0)