-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modeled Coverage - Phase 1 #578
Changes from 4 commits
0479b5f
498685e
bab457f
60814f7
e52dc60
e35ee73
7e04c77
54bcaed
ca0434d
da1ccb2
8a1e2a6
57da60b
ba97a7e
74d6eb8
64fa0b3
8c52ceb
a1c254d
6619bfd
99505a3
6b5c69e
035e4a9
242ad5a
349a92e
567bd35
a5c9d4d
9d1dffb
0f5cd3d
cb0ae3c
d886af8
5cd1b75
fee3eb3
e35c82b
985c990
d066c29
a71a601
1deea42
9c88a27
45638d5
cf527c1
c37f583
f4ca43e
aaa172f
f6ee1fa
20e656e
d95f40d
a662860
49c2f1e
3c8fb99
4223a4c
1de328f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ use futures::{ | |
stream::{Stream, StreamExt, TryStreamExt}, | ||
TryFutureExt, | ||
}; | ||
use h3o::LatLng; | ||
// use h3o::LatLng; | ||
use helium_crypto::PublicKeyBinary; | ||
use helium_proto::services::poc_mobile as proto; | ||
use mobile_config::{gateway_info::GatewayInfoResolver, GatewayClient}; | ||
|
@@ -132,16 +132,22 @@ impl HeartbeatDaemon { | |
|
||
while let Some(heartbeat) = validated_heartbeats.next().await.transpose()? { | ||
if heartbeat.is_valid() && heartbeat.coverage_object.is_some() { | ||
let coverage_claim_time = coverage_claim_time_cache | ||
if let Some(coverage_claim_time) = coverage_claim_time_cache | ||
.fetch_coverage_claim_time( | ||
&heartbeat.cbsd_id, | ||
&heartbeat.coverage_object, | ||
&mut transaction, | ||
) | ||
.await?; | ||
heartbeat | ||
.update_seniority(coverage_claim_time, &self.seniority_sink, &mut transaction) | ||
.await?; | ||
.await? | ||
{ | ||
heartbeat | ||
.update_seniority( | ||
coverage_claim_time, | ||
&self.seniority_sink, | ||
&mut transaction, | ||
) | ||
.await?; | ||
} | ||
} | ||
|
||
heartbeat.write(&self.heartbeat_sink).await?; | ||
|
@@ -393,7 +399,7 @@ impl Heartbeat { | |
INSERT INTO heartbeats (cbsd_id, hotspot_key, cell_type, latest_timestamp, truncated_timestamp, coverage_object) | ||
VALUES ($1, $2, $3, $4, $5, $6) | ||
maplant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ON CONFLICT (cbsd_id, truncated_timestamp) DO UPDATE SET | ||
latest_timestamp = EXCLUDED.latest_timestamp | ||
latest_timestamp = EXCLUDED.latest_timestamp, | ||
coverage_object = EXCLUDED.coverage_object | ||
RETURNING (xmax = 0) as inserted | ||
"# | ||
|
@@ -414,9 +420,9 @@ impl Heartbeat { | |
async fn validate_heartbeat( | ||
heartbeat: &CellHeartbeatIngestReport, | ||
gateway_client: &GatewayClient, | ||
coverage_cache: &CoveredHexCache, | ||
_coverage_cache: &CoveredHexCache, | ||
epoch: &Range<DateTime<Utc>>, | ||
max_distance: f64, | ||
_max_distance: f64, | ||
) -> anyhow::Result<(Option<CellType>, proto::HeartbeatValidity)> { | ||
let cell_type = match CellType::from_cbsd_id(&heartbeat.report.cbsd_id) { | ||
Some(ty) => Some(ty), | ||
|
@@ -439,9 +445,9 @@ async fn validate_heartbeat( | |
return Ok((cell_type, proto::HeartbeatValidity::GatewayOwnerNotFound)); | ||
} | ||
|
||
/* | ||
let Some(coverage_object) = heartbeat.report.coverage_object() else { | ||
maplant marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return Ok((cell_type, proto::HeartbeatValidity::Valid)); | ||
// return Ok((cell_type, proto::HeartbeatValidity::BadCoverageObject)); | ||
return Ok((cell_type, proto::HeartbeatValidity::BadCoverageObject)); | ||
}; | ||
|
||
let Some(coverage) = coverage_cache.fetch_coverage(&coverage_object).await? else { | ||
|
@@ -459,6 +465,7 @@ async fn validate_heartbeat( | |
if coverage.max_distance_km(latlng) > max_distance { | ||
return Ok((cell_type, proto::HeartbeatValidity::TooFarFromCoverage)); | ||
} | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you said "removed" did you mean more specifically that we should be invalidating these in phase 3 so this is only temporarily commented out or was this intended to be deleted once it successfully compiled or something? |
||
|
||
Ok((cell_type, proto::HeartbeatValidity::Valid)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed or will this come into play in phase 3?