Skip to content

Commit 089a5ef

Browse files
committed
clear the cached workspace on DB error
Signed-off-by: Callum Styan <callumstyan@gmail.com>
1 parent 15081e8 commit 089a5ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

coderd/agentapi/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ func (a *API) refreshCachedWorkspace(ctx context.Context) {
278278
ws, err := a.opts.Database.GetWorkspaceByID(ctx, a.opts.WorkspaceID)
279279
if err != nil {
280280
a.opts.Log.Warn(ctx, "failed to refresh cached workspace fields", slog.Error(err))
281+
a.cachedWorkspaceFields.Clear()
281282
return
282283
}
283284

0 commit comments

Comments
 (0)