refactor(store): context propagation + Postgres TIMESTAMPTZ #106
Reference in New Issue
Block a user
Delete Branch "refactor/store-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Phase 4 of the review-findings backlog — store hardening.
Commit 1 — context propagation (28 files):
context.Context(Close excluded)db.Query/Exec/QueryRowcalls →*ContextvariantsDeleteSite/ImportDatauseBeginTx(ctx)instead ofBegin()RunCheck+ all sub-checks accept parent context — HTTP checks inherit shutdown cancellationdbWrite.exectakes ctx so the writer goroutine can cancel stuck operationsr.Context()for HTTP handlers,context.Background()for init/TUICommit 2 — Postgres TIMESTAMPTZ:
TIMESTAMPcolumns →TIMESTAMPTZin CREATE TABLEALTER COLUMN ... TYPE TIMESTAMPTZmigration statements for existing databasesTest plan
go test -count=1 ./...— all pass (CGO=0)go test -race ./...— all pass (CGO=1)golangci-lint— 0 issuesdb.Query(/db.Exec(/db.QueryRow(remaining (all *Context)