Skip to content

Commit 6d119f8

Browse files
committed
make gen/fmt
1 parent 5c1dbe3 commit 6d119f8

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

coderd/database/dbfake/dbfake.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5251,7 +5251,7 @@ func (q *fakeQuerier) UpdateWorkspaceLastUsedAt(_ context.Context, arg database.
52515251
return sql.ErrNoRows
52525252
}
52535253

5254-
func (q *fakeQuerier) UpdateWorkspaceLockedDeletingAt(ctx context.Context, arg database.UpdateWorkspaceLockedDeletingAtParams) error {
5254+
func (q *fakeQuerier) UpdateWorkspaceLockedDeletingAt(_ context.Context, arg database.UpdateWorkspaceLockedDeletingAtParams) error {
52555255
if err := validateDatabaseType(arg); err != nil {
52565256
return err
52575257
}
@@ -5370,18 +5370,18 @@ func (q *fakeQuerier) UpdateWorkspacesDeletingAtByTemplateID(_ context.Context,
53705370
return err
53715371
}
53725372

5373-
if arg.LockedTtlMs == 0 {
5374-
return nil
5375-
}
5376-
5377-
for _, ws := range q.workspaces {
5373+
for i, ws := range q.workspaces {
53785374
if ws.LockedAt.Time.IsZero() {
53795375
continue
53805376
}
5381-
ws.DeletingAt = sql.NullTime{
5382-
Valid: true,
5383-
Time: ws.LockedAt.Time.Add(time.Duration(arg.LockedTtlMs) * time.Millisecond),
5377+
deletingAt := sql.NullTime{
5378+
Valid: arg.LockedTtlMs > 0,
5379+
}
5380+
if arg.LockedTtlMs > 0 {
5381+
deletingAt.Time = ws.LockedAt.Time.Add(time.Duration(arg.LockedTtlMs) * time.Millisecond)
53845382
}
5383+
ws.DeletingAt = deletingAt
5384+
q.workspaces[i] = ws
53855385
}
53865386

53875387
return nil

coderd/database/queries.sql.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/workspaces.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ func (api *API) putWorkspaceLock(rw http.ResponseWriter, r *http.Request) {
800800
}
801801
return nil
802802
}, nil)
803-
804803
if err != nil {
805804
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
806805
Message: "Internal error updating workspace locked status.",
@@ -1133,9 +1132,7 @@ func convertWorkspace(
11331132
}
11341133
}
11351134

1136-
var (
1137-
ttlMillis = convertWorkspaceTTLMillis(workspace.Ttl)
1138-
)
1135+
ttlMillis := convertWorkspaceTTLMillis(workspace.Ttl)
11391136

11401137
return codersdk.Workspace{
11411138
ID: workspace.ID,

enterprise/coderd/provisionerdaemons.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,3 @@ func websocketNetConn(ctx context.Context, conn *websocket.Conn, msgType websock
307307
Conn: nc,
308308
}
309309
}
310-

0 commit comments

Comments
 (0)