feat(sense): complete T-006 five-stream integration
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user