update timer

This commit is contained in:
Luke Pulverenti 2016-01-29 21:42:53 -05:00
parent b82b6fc975
commit b1c9984498

View File

@ -4,6 +4,7 @@ using MediaBrowser.Model.Logging;
using System; using System;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Common.Threading;
namespace MediaBrowser.Server.Implementations.EntryPoints namespace MediaBrowser.Server.Implementations.EntryPoints
{ {
@ -22,7 +23,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
/// </summary> /// </summary>
private readonly ILogger _logger; private readonly ILogger _logger;
private Timer _timer; private PeriodicTimer _timer;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="LoadRegistrations" /> class. /// Initializes a new instance of the <see cref="LoadRegistrations" /> class.
@ -41,7 +42,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
/// </summary> /// </summary>
public void Run() public void Run()
{ {
_timer = new Timer(s => LoadAllRegistrations(), null, TimeSpan.FromMilliseconds(100), TimeSpan.FromHours(12)); _timer = new PeriodicTimer(s => LoadAllRegistrations(), null, TimeSpan.FromMilliseconds(100), TimeSpan.FromHours(12));
} }
private async Task LoadAllRegistrations() private async Task LoadAllRegistrations()