Skip to content

Commit 383eed9

Browse files
authored
fix: use correct logger for lifecycle_executor (#11763)
1 parent e828dab commit 383eed9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

coderd/autobuild/lifecycle_executor.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ func (e *Executor) runOnce(t time.Time) Stats {
130130

131131
for _, ws := range workspaces {
132132
wsID := ws.ID
133-
log := e.log.With(slog.F("workspace_id", wsID))
133+
wsName := ws.Name
134+
log := e.log.With(
135+
slog.F("workspace_id", wsID),
136+
slog.F("workspace_name", wsName),
137+
)
134138

135139
eg.Go(func() error {
136140
err := func() error {
@@ -256,7 +260,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
256260
// If the transition didn't succeed then updating the workspace
257261
// to indicate dormant didn't either.
258262
auditLog.Success = err == nil
259-
auditBuild(e.ctx, e.log, *e.auditor.Load(), *auditLog)
263+
auditBuild(e.ctx, log, *e.auditor.Load(), *auditLog)
260264
}
261265
if err != nil {
262266
return xerrors.Errorf("transition workspace: %w", err)
@@ -274,7 +278,7 @@ func (e *Executor) runOnce(t time.Time) Stats {
274278
return nil
275279
}()
276280
if err != nil {
277-
e.log.Error(e.ctx, "failed to transition workspace", slog.Error(err))
281+
log.Error(e.ctx, "failed to transition workspace", slog.Error(err))
278282
statsMu.Lock()
279283
stats.Errors[wsID] = err
280284
statsMu.Unlock()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy