cph-cachet / carp.core-kotlin

Infrastructure-agnostic framework for distributed data collection.
https://carp.cachet.dk/core/
MIT License
21 stars 3 forks source link

Should `DataStreamService.openDataStreams` not fail for existing streams? #414

Open Whathecode opened 2 years ago

Whathecode commented 2 years ago

Currently, when calling DataStreamService.openDataStreams, a IllegalStateException is thrown when data streams for the same studyDeploymentId have already been configured.

This exception currently is caught and ignored in DeploymentService when deploying a device, since when a device is re-deployed, the data streams have already been opened as part of the previous deployment.

Currently, there is no state held in StudyDeployment to keep track of previous deployments, which could conditionally call openDataStreams. This would be one solution to preventing this exception.

Alternatively, possibly openDataStreams should simply succeed if the requested DataStreamsConfiguration matches those of the already opened data streams for the given studyDeploymentID?