aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-06-30 15:27:06 -0400
committerGitHub <noreply@github.com>2016-06-30 15:27:06 -0400
commit2708df6cc28c48a89416bdfbdde7e78fc4227c62 (patch)
tree9f892d6350a4d694c96985d679f622c0f7005278 /MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs
parentd9406d48ca0231bc096aeadc595c30f0596c8dda (diff)
parent5bdc96bb6a9b863980661e2d11c1ad00a02eb601 (diff)
Merge pull request #1899 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs')
-rw-r--r--MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs39
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);
}
}
}