Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyKomodo committed Jan 13, 2024
1 parent 2aa4403 commit 45454ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ where
set_abort(abort);

// The reason this is allowed to be asserted is because we're catching the panic
// and returning None instead of propagating it, if the panic was caused by a task abort.
// and returning None instead of propagating it, if the panic was caused by a
// task abort.
match std::panic::catch_unwind(std::panic::AssertUnwindSafe(f)) {
Ok(r) => Some(r),
Err(err) => {
Expand Down
3 changes: 2 additions & 1 deletion platform/image_processor/src/processor/job/decoder/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ impl<'data> FfmpegDecoder<'data> {
let input_stream_duration = input_stream.duration().unwrap_or(0);
let input_stream_frames = input_stream
.nb_frames()
.ok_or_else(|| ProcessorError::FfmpegDecode(anyhow!("no frame count")))?.max(1);
.ok_or_else(|| ProcessorError::FfmpegDecode(anyhow!("no frame count")))?
.max(1);

if input_stream_time_base.den == 0 || input_stream_time_base.num == 0 {
return Err(ProcessorError::FfmpegDecode(anyhow!("stream time base is 0")));
Expand Down
4 changes: 2 additions & 2 deletions platform/image_processor/src/processor/job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ impl<'a, G: ImageProcessorGlobal> Job<'a, G> {
self.global.config().source_bucket.name,
self.job.task.input_path
);

let response = self
.global
.s3_source_bucket()
.get_object(&self.job.task.input_path)
.await
.map_err(ProcessorError::S3Download)?;

if (200..299).contains(&response.status_code()) {
Ok(response.bytes().clone())
} else {
Expand Down

0 comments on commit 45454ff

Please sign in to comment.