< Summary - Jellyfin

Information
Class: Jellyfin.Server.Implementations.Events.Consumers.System.PendingRestartNotifier
Assembly: Jellyfin.Server.Implementations
File(s): /srv/git/jellyfin/Jellyfin.Server.Implementations/Events/Consumers/System/PendingRestartNotifier.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 2
Coverable lines: 2
Total lines: 31
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

Metrics

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

File(s)

/srv/git/jellyfin/Jellyfin.Server.Implementations/Events/Consumers/System/PendingRestartNotifier.cs

#LineLine coverage
 1using System.Threading;
 2using System.Threading.Tasks;
 3using Jellyfin.Data.Events.System;
 4using MediaBrowser.Controller.Events;
 5using MediaBrowser.Controller.Session;
 6
 7namespace Jellyfin.Server.Implementations.Events.Consumers.System
 8{
 9    /// <summary>
 10    /// Notifies users when there is a pending restart.
 11    /// </summary>
 12    public class PendingRestartNotifier : IEventConsumer<PendingRestartEventArgs>
 13    {
 14        private readonly ISessionManager _sessionManager;
 15
 16        /// <summary>
 17        /// Initializes a new instance of the <see cref="PendingRestartNotifier"/> class.
 18        /// </summary>
 19        /// <param name="sessionManager">The session manager.</param>
 20        public PendingRestartNotifier(ISessionManager sessionManager)
 21        {
 022            _sessionManager = sessionManager;
 023        }
 24
 25        /// <inheritdoc />
 26        public async Task OnEvent(PendingRestartEventArgs eventArgs)
 27        {
 28            await _sessionManager.SendRestartRequiredNotification(CancellationToken.None).ConfigureAwait(false);
 29        }
 30    }
 31}