diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-01-28 22:40:21 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-01-28 22:40:21 -0500 |
| commit | 3510ef3d2beb810c87f8f3d52f95b95110e574d0 (patch) | |
| tree | b5ed7084d32c7f4420b26fad92aaee5e7c7f65c7 /MediaBrowser.Server.Implementations/Connect | |
| parent | 8ff5d4af47d9b4fd145206d8609c4894c4ace057 (diff) | |
reduce use of timers throughout the system
Diffstat (limited to 'MediaBrowser.Server.Implementations/Connect')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 6dab136a5..0d6b8ac26 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -13,12 +13,13 @@ using System.Threading; using System.Threading.Tasks; using CommonIO; using MediaBrowser.Common.IO; +using MediaBrowser.Common.Threading; namespace MediaBrowser.Server.Implementations.Connect { public class ConnectEntryPoint : IServerEntryPoint { - private Timer _timer; + private PeriodicTimer _timer; private readonly IHttpClient _httpClient; private readonly IApplicationPaths _appPaths; private readonly ILogger _logger; @@ -43,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Connect { Task.Run(() => LoadCachedAddress()); - _timer = new Timer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3)); + _timer = new PeriodicTimer(null, new TimerCallback(TimerCallback), TimeSpan.FromSeconds(5), TimeSpan.FromHours(3)); } private readonly string[] _ipLookups = { "http://bot.whatismyipaddress.com", "https://connect.emby.media/service/ip" }; |
