fix(scheduler): убрать двойной SaveCheckRun (Checker персистит), SetDrift через CountDriftDomains, resolved после error

This commit is contained in:
2026-07-04 14:03:49 +07:00
parent 23e02d6804
commit 9475af441e
5 changed files with 60 additions and 32 deletions
+8
View File
@@ -258,6 +258,14 @@ func (s *Store) SetDomainStatus(ctx context.Context, domainID uuid.UUID, status
return s.q.SetDomainStatus(ctx, db.SetDomainStatusParams{ID: domainID, LastCheckStatus: status})
}
// CountDriftDomains returns the current number of domains system-wide whose
// last check status is "drift". This is a global count (not per-project) —
// it backs the dns_ar_drift_domains gauge, which is a system-level metric.
func (s *Store) CountDriftDomains(ctx context.Context) (int, error) {
n, err := s.q.CountDriftDomains(ctx)
return int(n), err
}
// User and Project are provider-neutral domain structs for the auth/tenant
// layer (Фаза 2), mirroring the Account/Template/Domain wrappers above so
// callers never need to import internal/store/db directly.