Skip to content

Commit

Permalink
Have iOS telephony probe store null if no calls were found, to update…
Browse files Browse the repository at this point in the history
… store time and produce proper health checks.
  • Loading branch information
MatthewGerber committed Jul 29, 2015
1 parent 3b588b5 commit c58eb89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Sensus.iOS/Probes/Communication/iOSTelephonyProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ protected override IEnumerable<Datum> Poll(CancellationToken cancellationToken)
_calls.Clear();
}

// if we didn't find any calls, return a null to indicate that the poll went through but didn't find anything.
if (data.Count == 0)
data.Add(null);

return data;
}
}
Expand Down
2 changes: 1 addition & 1 deletion SensusService/Probes/Network/PollingWlanProbe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public sealed override int DefaultPollingSleepDurationMS
}
}
}
}
}
1 change: 1 addition & 0 deletions SensusService/Probes/Probe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public virtual void Start()

public virtual void StoreDatum(Datum datum)
{
// datum is allowed to be null, indicating the the probe attempted to obtain data but it didn't find any (in the case of polling probes).
if (datum != null)
{
datum.ProtocolId = Protocol.Id;
Expand Down

0 comments on commit c58eb89

Please sign in to comment.