ohcnetwork / teleicu_middleware

Middleware to help tunnel CCTV Streams and ONVIF APIs for TeleICU.
MIT License
3 stars 14 forks source link

Remove camerasStatusBodyValidators and fix timeout #99

Closed Ashesh3 closed 1 year ago

Ashesh3 commented 1 year ago

Fixes #98

This PR removes the camerasStatusBodyValidators middleware from the "/cameras/status" endpoint.

The middleware was previously used to validate the request body for the POST route. However, it was found that the middleware was causing issues when any camera asset under the same middleware was misconfigured. This led to the middleware incorrectly marking all assets as 'down'.

To resolve this, the validation has been removed from the middleware and instead added directly within the fetchCameraStatuses function in the CameraController. This allows the function to ignore any misconfigured assets and continue processing the remaining assets.

The changes in this PR include:

  1. Removal of camerasStatusBodyValidators from cameraValidators.js
  2. Removal of validate(camerasStatusBodyValidators) from the POST route in cameraRouter.js