Add more robust error handling for AudioNormalizationTask (#14728)
Some checks failed
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
OpenAPI / OpenAPI - HEAD (push) Has been cancelled
OpenAPI / OpenAPI - BASE (push) Has been cancelled
OpenAPI / OpenAPI - Difference (push) Has been cancelled
OpenAPI / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI / OpenAPI - Publish Stable Spec (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled

This commit is contained in:
Bond-009
2025-09-04 05:12:24 +02:00
committed by GitHub
parent 71048917dd
commit c7320dc189

View File

@@ -122,7 +122,14 @@ public partial class AudioNormalizationTask : IScheduledTask
}
finally
{
File.Delete(tempFile);
try
{
File.Delete(tempFile);
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to delete concat file: {FileName}.", tempFile);
}
}
}
}
@@ -232,11 +239,10 @@ public partial class AudioNormalizationTask : IScheduledTask
},
})
{
_logger.LogDebug("Starting ffmpeg with arguments: {Arguments}", args);
try
{
_logger.LogDebug("Starting ffmpeg with arguments: {Arguments}", args);
process.Start();
process.PriorityClass = ProcessPriorityClass.BelowNormal;
}
catch (Exception ex)
{
@@ -244,6 +250,15 @@ public partial class AudioNormalizationTask : IScheduledTask
return null;
}
try
{
process.PriorityClass = ProcessPriorityClass.BelowNormal;
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Error setting ffmpeg process priority");
}
using var reader = process.StandardError;
float? lufs = null;
await foreach (var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false))