Skip to content

Commit 48285de

Browse files
committedMar 3, 2015
Log, if no update is available
1 parent 093147c commit 48285de

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed
 

‎Espera.View/ViewModels/UpdateViewModel.cs

+15-12
Original file line numberDiff line numberDiff line change
@@ -126,22 +126,25 @@ private async Task UpdateSilentlyAsync()
126126
return;
127127
}
128128

129-
if (appliedEntry != null)
129+
if (appliedEntry == null)
130130
{
131-
await ChangelogFetcher.FetchAsync().ToObservable()
132-
.Timeout(TimeSpan.FromSeconds(30))
133-
.SelectMany(x => BlobCache.LocalMachine.InsertObject(BlobCacheKeys.Changelog, x))
134-
.LoggedCatch(this, Observable.Return(Unit.Default), "Could not to fetch changelog")
135-
.ToTask();
131+
this.Log().Info("No update available");
132+
return;
133+
}
136134

137-
lock (this.updateLock)
138-
{
139-
this.updateRun = true;
140-
this.settings.IsUpdated = true;
141-
}
135+
await ChangelogFetcher.FetchAsync().ToObservable()
136+
.Timeout(TimeSpan.FromSeconds(30))
137+
.SelectMany(x => BlobCache.LocalMachine.InsertObject(BlobCacheKeys.Changelog, x))
138+
.LoggedCatch(this, Observable.Return(Unit.Default), "Could not to fetch changelog")
139+
.ToTask();
142140

143-
this.Log().Info("Updated to version {0}", appliedEntry.Version);
141+
lock (this.updateLock)
142+
{
143+
this.updateRun = true;
144+
this.settings.IsUpdated = true;
144145
}
146+
147+
this.Log().Info("Updated to version {0}", appliedEntry.Version);
145148
}
146149
}
147150
}

0 commit comments

Comments
 (0)
Please sign in to comment.