Address review nits on #169: stamp name, migration comment (#169)

This commit is contained in:
2026-08-22 23:18:45 +07:00
parent b517858619
commit 86da47850c
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -686,12 +686,12 @@ func (p *Poller) checkOne(ctx context.Context, sr store.Series) (outcome readOut
// stamp's value: a Series still completed keeps its original stamp, so the // stamp's value: a Series still completed keeps its original stamp, so the
// age #170 prints is "since the Site first said so"; one that stopped // age #170 prints is "since the Site first said so"; one that stopped
// being completed is zeroed. // being completed is zeroed.
want := int64(0) stamp := int64(0)
if facts.SiteCompleted { if facts.SiteCompleted {
want = p.Now().UnixMilli() stamp = p.Now().UnixMilli()
} }
if (sr.SiteCompletedAt == 0) != (want == 0) { if (sr.SiteCompletedAt == 0) != (stamp == 0) {
if err := p.Store.SetSiteCompletedAt(sr.Site, sr.SeriesID, want); err != nil { if err := p.Store.SetSiteCompletedAt(sr.Site, sr.SeriesID, stamp); err != nil {
// Best-effort, like every poller write: never change the outcome // Best-effort, like every poller write: never change the outcome
// word the pass counts. // word the pass counts.
log.Printf("latest poll %q: set site completed: %v", sr.Key(), err) log.Printf("latest poll %q: set site completed: %v", sr.Key(), err)
@@ -1,4 +1,4 @@
-- When the last successful Poll read saw the Site's own completed value -- When the last successful Poll read saw the Site's own completed value
-- (#168): epoch-ms, zero meaning it did not. DEFAULT 0 keeps pre-existing -- (#168): epoch-ms, zero meaning it did not. DEFAULT 0 keeps pre-existing
-- rows readable; nothing reads it yet — #170 is the surface. -- rows readable.
ALTER TABLE series ADD COLUMN site_completed_at bigint NOT NULL DEFAULT 0; ALTER TABLE series ADD COLUMN site_completed_at bigint NOT NULL DEFAULT 0;