Skip to content

Commit

Permalink
Set LastPoll before querying status. Otherwise the app may hang when …
Browse files Browse the repository at this point in the history
…exceptions are thrown.
  • Loading branch information
dominikgolda committed Apr 18, 2019
1 parent bfb803e commit 3af813c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Soloplan.WhatsON/ObservationScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ private async Task StartObserveSingle(ObservationSubject subject, CancellationTo
if (DateTime.Now - subject.LastPoll > subject.Interval)
{
log.Log(LogLevel.Trace, "Observation of {@subject} started.", subject);
await subject.Subject.QueryStatus(token);
subject.LastPoll = DateTime.Now;
await subject.Subject.QueryStatus(token);
if (subject.Running)
{
this.StatusQueried?.Invoke(this, subject.Subject);
Expand Down

0 comments on commit 3af813c

Please sign in to comment.