Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: re-enable terraform caching
why was this disabled???
  • Loading branch information
ammario committed May 9, 2023
commit 3445b4ffe37a8a68bfb8a2a81bd986a01a08aa8a
4 changes: 1 addition & 3 deletions cli/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
notifyCtx, notifyStop := signal.NotifyContext(ctx, InterruptSignals...)
defer notifyStop()

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

// Clean up idle connections at the end, e.g.
// embedded-postgres can leave an idle connection
Expand Down
8 changes: 7 additions & 1 deletion coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"flag"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -878,7 +879,12 @@ func (api *API) Close() error {
}

func compressHandler(h http.Handler) http.Handler {
cmp := middleware.NewCompressor(5,
level := 5
if flag.Lookup("test.v") != nil {
level = 1
}

cmp := middleware.NewCompressor(level,
"text/*",
"application/*",
"image/*",
Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func Install(ctx context.Context, log slog.Logger, dir string, wantVersion *vers
log.Debug(
ctx,
"installing terraform",
slog.F("prev_version", hasVersion),
slog.F("dir", dir),
slog.F("version", TerraformVersion),
)
Expand Down