Skip to content

Commit 21fa66b

Browse files
committed
Complete self review
1 parent bf7f5ab commit 21fa66b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
ALTER TABLE ONLY users
22
DROP COLUMN last_seen_at;
3-

coderd/httpmw/apikey.go

+3
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ func ExtractAPIKey(cfg ExtractAPIKeyConfig) func(http.Handler) http.Handler {
318318
}
319319
}
320320

321+
// We only want to update this occasionally to reduce DB write
322+
// load. We update alongside the UserLink and APIKey since it's
323+
// easier on the DB to colocate writes.
321324
_, err = cfg.DB.UpdateUserLastSeenAt(ctx, database.UpdateUserLastSeenAtParams{
322325
ID: key.UserID,
323326
LastSeenAt: database.Now(),

0 commit comments

Comments
 (0)