feat(sense): complete T-006 five-stream integration
Harness governance / validate (push) Has been cancelled
Harness governance / validate (pull_request) Has been cancelled

This commit is contained in:
QiuSW
2026-08-07 16:33:35 +08:00
parent 08692e33e9
commit 9567838045
19 changed files with 1658 additions and 14 deletions
+8 -1
View File
@@ -15,6 +15,7 @@ const defaultBatchSize = 128
type Repository interface {
ListEnabledVideoDevices(ctx context.Context, limit int) ([]device.Device, error)
UpdateActualState(ctx context.Context, id string, state device.ActualState, now time.Time) error
RequestReconcile(ctx context.Context, id string, now time.Time) error
}
type RuntimePaths interface {
@@ -50,7 +51,13 @@ func (c *Checker) RunOnce(ctx context.Context) error {
if probeErr == nil && ready {
state = device.ActualOnline
}
if updateErr := c.repository.UpdateActualState(ctx, value.ID, state, c.now().UTC()); updateErr != nil {
now := c.now().UTC()
if probeErr != nil {
if requestErr := c.repository.RequestReconcile(ctx, value.ID, now); requestErr != nil {
runErrors = append(runErrors, fmt.Errorf("request device %s reconciliation: %w", value.ID, requestErr))
}
}
if updateErr := c.repository.UpdateActualState(ctx, value.ID, state, now); updateErr != nil {
runErrors = append(runErrors, fmt.Errorf("update device %s health: %w", value.ID, updateErr))
}
if probeErr != nil {