This commit is contained in:
Ericson Soares 2024-09-29 02:08:59 -03:00
parent 16f37c9216
commit 70ea030c97
9 changed files with 39 additions and 25 deletions

View File

@ -82,7 +82,7 @@ enum IngestStatus {
} }
impl Ingester { impl Ingester {
pub const fn new( pub const fn new(
sync: SyncManager, sync: SyncManager,
ingest_notify: Arc<Notify>, ingest_notify: Arc<Notify>,
active: Arc<AtomicBool>, active: Arc<AtomicBool>,

View File

@ -1167,7 +1167,8 @@ impl JobTaskDispatcher {
matches!( matches!(
*state, *state,
JobRunningState::Running JobRunningState::Running
| JobRunningState::Canceled | JobRunningState::Shutdown | JobRunningState::Canceled
| JobRunningState::Shutdown
) )
}) })
.await .await

View File

@ -344,8 +344,10 @@ impl Status {
matches!( matches!(
self, self,
Self::Completed Self::Completed
| Self::Canceled | Self::Paused | Self::Canceled
| Self::Failed | Self::CompletedWithErrors | Self::Paused
| Self::Failed
| Self::CompletedWithErrors
) )
} }
} }

View File

@ -83,7 +83,9 @@ pub async fn load_jobs<OuterCtx: OuterContext, JobCtx: JobContext<OuterCtx>>(
root_job: StoredJob { id, .. }, root_job: StoredJob { id, .. },
next_jobs, next_jobs,
.. ..
}| { iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id)) }, }| {
iter::once(*id).chain(next_jobs.iter().map(|StoredJob { id, .. }| *id))
},
) )
.map(|job_id| uuid_to_bytes(&job_id)) .map(|job_id| uuid_to_bytes(&job_id))
.collect::<Vec<_>>(), .collect::<Vec<_>>(),

View File

@ -61,12 +61,15 @@ pub const fn can_extract_for_audio(audio_extension: AudioExtension) -> bool {
matches!( matches!(
audio_extension, audio_extension,
Mp3 | Mp2 Mp3 | Mp2
| M4a | Wav | Aiff | M4a | Wav
| Aif | Flac | Ogg | Aiff | Aif
| Oga | Opus | Wma | Flac | Ogg
| Amr | Aac | Wv | Oga | Opus
| Voc | Tta | Loas | Wma | Amr
| Caf | Aptx | Adts | Aac | Wv
| Voc | Tta
| Loas | Caf
| Aptx | Adts
| Ast | Mid | Ast | Mid
) )
} }
@ -81,15 +84,18 @@ pub const fn can_extract_for_video(video_extension: VideoExtension) -> bool {
matches!( matches!(
video_extension, video_extension,
Avi | Avifs Avi | Avifs
| Qt | Mov | Swf | Qt | Mov
| Mjpeg | Mpeg | Swf | Mjpeg
| Mxf | M2v | Mpg | Mpeg | Mxf
| Mpe | M2ts | Flv | M2v | Mpg
| Wm | _3gp | M4v | Mpe | M2ts
| Wmv | Asf | Mp4 | Flv | Wm
| Webm | Mkv | Vob | _3gp | M4v
| Ogv | Wtv | Hevc | Wmv | Asf
| F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension | Mp4 | Webm
| Mkv | Vob
| Ogv | Wtv
| Hevc | F4v // | Ts | Mts TODO: Uncomment when we start using magic instead of extension
) )
} }

View File

@ -284,7 +284,7 @@ impl Manager {
device_pub_id: &'a DevicePubId, device_pub_id: &'a DevicePubId,
chunk_size: u32, chunk_size: u32,
initial_timestamp: NTP64, initial_timestamp: NTP64,
) -> impl Stream<Item = Result<Vec<CRDTOperation>, Error>> + Send + '_ { ) -> impl Stream<Item = Result<Vec<CRDTOperation>, Error>> + Send + 'a {
stream! { stream! {
let mut current_initial_timestamp = initial_timestamp; let mut current_initial_timestamp = initial_timestamp;

View File

@ -752,7 +752,8 @@ async fn create_location(
.location() .location()
.count(vec![location::path::equals(Some(path.clone()))]) .count(vec![location::path::equals(Some(path.clone()))])
.exec() .exec()
.await? > 0 .await?
> 0
{ {
return Err(LocationError::LocationAlreadyExists(location_path.into())); return Err(LocationError::LocationAlreadyExists(location_path.into()));
} }

View File

@ -418,8 +418,10 @@ impl JobStatus {
matches!( matches!(
self, self,
Self::Completed Self::Completed
| Self::Canceled | Self::Paused | Self::Canceled
| Self::Failed | Self::CompletedWithErrors | Self::Paused
| Self::Failed
| Self::CompletedWithErrors
) )
} }
} }

View File

@ -169,7 +169,7 @@ impl<Id: ActorId> ActorsCollection<Id> {
#[instrument(skip(self))] #[instrument(skip(self))]
pub async fn start(&self, identifier: Id) { pub async fn start(&self, identifier: Id) {
let mut actors_map = self.actors_map.write().await; let mut actors_map = self.actors_map.write().await;
if let Some(actor) = actors_map.get_mut(&identifier) { if let Some(actor) = actors_map.get_mut(&identifier) {
if actor.is_running.load(Ordering::Acquire) { if actor.is_running.load(Ordering::Acquire) {
warn!("Actor already running!"); warn!("Actor already running!");