diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-29 14:48:26 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-29 14:48:26 -0400 |
| commit | dc5f2dd440f0413c7de9766b7a630116e22afcec (patch) | |
| tree | 8c76e7c431782b582124ea5abe84078594edd298 /MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs | |
| parent | 636969e7ffbaafec3f458de4299966776bc72737 (diff) | |
update logging
Diffstat (limited to 'MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs index 090966d2b..b34d57c42 100644 --- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs +++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs @@ -122,30 +122,27 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks { get { - if (_lastExecutionResult == null) - { - var path = GetHistoryFilePath(); + var path = GetHistoryFilePath(); - lock (_lastExecutionResultSyncLock) + lock (_lastExecutionResultSyncLock) + { + if (_lastExecutionResult == null) { - if (_lastExecutionResult == null) + try + { + _lastExecutionResult = JsonSerializer.DeserializeFromFile<TaskResult>(path); + } + catch (DirectoryNotFoundException) + { + // File doesn't exist. No biggie + } + catch (FileNotFoundException) + { + // File doesn't exist. No biggie + } + catch (Exception ex) { - try - { - return JsonSerializer.DeserializeFromFile<TaskResult>(path); - } - catch (DirectoryNotFoundException) - { - // File doesn't exist. No biggie - } - catch (FileNotFoundException) - { - // File doesn't exist. No biggie - } - catch (Exception ex) - { - Logger.ErrorException("Error deserializing {0}", ex, path); - } + Logger.ErrorException("Error deserializing {0}", ex, path); } } } |
