diff options
| author | Anthony Lavado <anthonylavado@users.noreply.github.com> | 2019-06-05 01:11:25 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-05 01:11:25 -0400 |
| commit | 256f44a87029577ed5daa7646c68e8a395e19708 (patch) | |
| tree | af2f46e34632fe989831f9f5873b6faccf830fc9 /MediaBrowser.Api/Library/LibraryService.cs | |
| parent | f631b2ecdc4554fb723f7e7939a1a6f4e21f4f06 (diff) | |
| parent | ce1fa42f9d39add8467bfed186730c4a9545344d (diff) | |
Merge pull request #994 from Bond-009/tasks
Remove Tasks wrapped in a Task
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 9f8da9c16..b6fec9bb7 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -999,19 +999,16 @@ namespace MediaBrowser.Api.Library /// Posts the specified request. /// </summary> /// <param name="request">The request.</param> - public void Post(RefreshLibrary request) + public async Task Post(RefreshLibrary request) { - Task.Run(() => + try { - try - { - _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None); - } - catch (Exception ex) - { - Logger.LogError(ex, "Error refreshing library"); - } - }); + await _libraryManager.ValidateMediaLibrary(new SimpleProgress<double>(), CancellationToken.None).ConfigureAwait(false); + } + catch (Exception ex) + { + Logger.LogError(ex, "Error refreshing library"); + } } /// <summary> |
