diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-31 15:15:33 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-31 15:15:33 -0400 |
| commit | 45db7d21b2a0a18b73253c64651a57c60880b084 (patch) | |
| tree | 3f6eb8bae23c5c7a3cab6e4c4ee34f8b2ba1838f /MediaBrowser.Server.Implementations/EntryPoints | |
| parent | 10dedf92adddeae707bae5a4204c8164f5bfea48 (diff) | |
localize plugin installation process
Diffstat (limited to 'MediaBrowser.Server.Implementations/EntryPoints')
| -rw-r--r-- | MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs b/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs index c2c4056f5..27170ced9 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/LoadRegistrations.cs @@ -2,6 +2,8 @@ using MediaBrowser.Controller.Plugins; using MediaBrowser.Model.Logging; using System; +using System.Threading; +using System.Threading.Tasks; namespace MediaBrowser.Server.Implementations.EntryPoints { @@ -20,6 +22,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints /// </summary> private readonly ILogger _logger; + private Timer _timer; + /// <summary> /// Initializes a new instance of the <see cref="LoadRegistrations" /> class. /// </summary> @@ -35,7 +39,12 @@ namespace MediaBrowser.Server.Implementations.EntryPoints /// <summary> /// Runs this instance. /// </summary> - public async void Run() + public void Run() + { + _timer = new Timer(s => LoadAllRegistrations(), null, TimeSpan.FromMilliseconds(100), TimeSpan.FromHours(24)); + } + + private async Task LoadAllRegistrations() { try { @@ -52,6 +61,11 @@ namespace MediaBrowser.Server.Implementations.EntryPoints /// </summary> public void Dispose() { + if (_timer != null) + { + _timer.Dispose(); + _timer = null; + } } } } |
