Skip to content

Commit

Permalink
Add some logging when cbrs events after the cbrs disable time are dro… (
Browse files Browse the repository at this point in the history
#960)

* Add some logging when cbrs events after the cbrs disable time are dropped

* remove .idea subdir

* Update ingest/src/server_mobile.rs

Co-authored-by: Jeff Grunewald <[email protected]>

* fix typo

---------

Co-authored-by: Jeff Grunewald <[email protected]>
  • Loading branch information
2 people authored and macpie committed Feb 28, 2025
1 parent 5fefe51 commit a63bfe4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ingest/src/server_mobile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,19 @@ where
request: Request<CellHeartbeatReqV1>,
) -> GrpcResult<CellHeartbeatRespV1> {
let timestamp = Utc::now();
let event = request.into_inner();

if timestamp >= self.cbrs_disable_time {
let pubkey = PublicKeyBinary::from(event.pub_key);
tracing::info!(
?pubkey,
"dropping CellHeartbeatReqV1 because cbrs disable time has passed"
);
return Ok(Response::new(CellHeartbeatRespV1 {
id: timestamp.to_string(),
}));
}

let event = request.into_inner();

custom_tracing::record_b58("pub_key", &event.pub_key);

let report = self
Expand Down Expand Up @@ -280,6 +284,16 @@ where
let event = request.into_inner();

if is_data_transfer_for_cbrs(&event) && timestamp > self.cbrs_disable_time {
let pubkey = event
.data_transfer_usage
.map(|usage| PublicKeyBinary::from(usage.pub_key))
.ok_or_else(|| anyhow::anyhow!("No pubkey available"));

tracing::info!(
?pubkey,
"dropping DataTransferSessionReqV1 because cbrs disable time has passed"
);

return Ok(Response::new(DataTransferSessionRespV1 {
id: timestamp.to_string(),
}));
Expand Down

0 comments on commit a63bfe4

Please sign in to comment.