Make failing to build media a soft error
This commit is contained in:
2 files changed
+13
-3
No files matched your search
@@ -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
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user