mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-13 08:37:07 +00:00
Make priority class setting more robust (#15177)
This commit is contained in:
parent
2b94bb54aa
commit
70c32a26fa
2 changed files with 18 additions and 2 deletions
|
|
@ -1122,7 +1122,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
private void StartProcess(ProcessWrapper process)
|
||||
{
|
||||
process.Process.Start();
|
||||
process.Process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
|
||||
try
|
||||
{
|
||||
process.Process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogWarning(ex, "Unable to set process priority to BelowNormal for {ProcessFileName}", process.Process.StartInfo.FileName);
|
||||
}
|
||||
|
||||
lock (_runningProcessesLock)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,7 +42,15 @@ public static class FfProbeKeyframeExtractor
|
|||
try
|
||||
{
|
||||
process.Start();
|
||||
process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
try
|
||||
{
|
||||
process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
}
|
||||
catch
|
||||
{
|
||||
// We do not care if process priority setting fails
|
||||
// Ideally log a warning but this does not have a logger available
|
||||
}
|
||||
|
||||
return ParseStream(process.StandardOutput);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue