Make failing to build media a soft error

This commit is contained in:
QuantumEntangledAndy committed 2023-10-10 11:53:33 +07:00
1 parent 6058d95b3a
commit 6824d52db7
2 files changed
+13 -3

No files matched your search

+3 -2
View File
@@ -1,6 +1,7 @@
//! This thread will listen to motion messages
//! from the camera.
use anyhow::Context;
use std::sync::Arc;
use tokio::{
sync::{
@@ -70,9 +71,9 @@ impl NeoCamMdThread {
let watcher = watcher.clone();
Box::pin(
async move {
let mut md = cam.listen_on_motion().await?;
let mut md = cam.listen_on_motion().await.with_context("Error in getting MD listen_on_motion")?;
loop {
let event = md.next_motion().await?;
let event = md.next_motion().await.with_context("Error in getting MD next_motion")?;
match event {
MotionStatus::Start(at) => {
watcher.send_replace(
+10 -1
View File
@@ -123,7 +123,16 @@ impl NeoMediaFactoryImpl {
}
fn build_pipeline(&self, media: Element) -> AnyResult<Option<Element>> {
match self.call_back.blocking_lock().as_ref() {
Some(call) => call(media),
Some(call) => {
let new_media = call(media);
match new_media {
Ok(new_media) => Ok(new_media),
Err(e) => {
log::debug!("Media source is currently restarting");
Ok(None)
}
}
}
None => Ok(None),
}
}