< Summary - Jellyfin

Information
Class: MediaBrowser.Common.Extensions.ProcessExtensions
Assembly: MediaBrowser.Common
File(s): /srv/git/jellyfin/MediaBrowser.Common/Extensions/ProcessExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 28
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 4/19/2026 - 12:14:27 AM Line coverage: 0% (0/4) Total lines: 28

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
WaitForExitAsync()100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Common/Extensions/ProcessExtensions.cs

#LineLine coverage
 1using System;
 2using System.Diagnostics;
 3using System.Threading;
 4using System.Threading.Tasks;
 5
 6namespace MediaBrowser.Common.Extensions
 7{
 8    /// <summary>
 9    /// Extension methods for <see cref="Process"/>.
 10    /// </summary>
 11    public static class ProcessExtensions
 12    {
 13        /// <summary>
 14        /// Asynchronously wait for the process to exit.
 15        /// </summary>
 16        /// <param name="process">The process to wait for.</param>
 17        /// <param name="timeout">The duration to wait before cancelling waiting for the task.</param>
 18        /// <returns>A task that will complete when the process has exited, cancellation has been requested, or an error
 19        /// <exception cref="OperationCanceledException">The timeout ended.</exception>
 20        public static async Task WaitForExitAsync(this Process process, TimeSpan timeout)
 21        {
 022            using (var cancelTokenSource = new CancellationTokenSource(timeout))
 23            {
 024                await process.WaitForExitAsync(cancelTokenSource.Token).ConfigureAwait(false);
 025            }
 026        }
 27    }
 28}

Methods/Properties

WaitForExitAsync()