fix(taste): drop unused now param + tighten test (golangci-lint revive)
golangci-lint v2 (CI-only; local is v1) flagged two unused-parameter issues: - BuildTasteProfile's `now` was genuinely dead — decay/windowing are computed DB-side via now(), so no Go-side timestamp is threaded. Removed it (a phase-3 context model that needs a pinned reference time would re-add it); updated the scheduler call site. - the degenerate-params engagement test ignored t; reworked it to assert the result stays in [-1,1], which also strengthens the test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"log/slog"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
@@ -81,9 +80,13 @@ func DefaultConfig() Config {
|
||||
// Self-contained transaction for the replace. Returns an error only on a
|
||||
// fatal DB failure; the daily caller logs and proceeds to playlist building
|
||||
// regardless (best-effort).
|
||||
//
|
||||
// The decay reference time is the database clock (age is computed in SQL via
|
||||
// now()), so no Go-side timestamp is threaded here; a phase-3 context model
|
||||
// that needs a pinned reference time would add one.
|
||||
func BuildTasteProfile(
|
||||
ctx context.Context, pool *pgxpool.Pool, logger *slog.Logger,
|
||||
userID pgtype.UUID, now time.Time, cfg Config,
|
||||
userID pgtype.UUID, cfg Config,
|
||||
) error {
|
||||
q := dbq.New(pool)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user