Skip to content

Commit

Permalink
More verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Aug 25, 2024
1 parent 90f2d4f commit 177f55e
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/follows_differ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ fn log_line(
maybe_latest_stored_updated_at: Option<Timestamp>,
event: &Event,
) -> Option<String> {
if unchanged > 0 && followed_counter == 0 && unfollowed_counter == 0 {
// This one is not interesting
return None;
}

let timestamp_diff = if let Some(latest_stored_updated_at) = maybe_latest_stored_updated_at {
format!(
"[{}->{}]",
Expand All @@ -215,13 +220,6 @@ fn log_line(
));
}

if followed_counter > 0 {
return Some(format!(
"Pubkey {}: date {}, {} followed, {} unfollowed, {} unchanged",
follower, timestamp_diff, followed_counter, unfollowed_counter, unchanged,
));
}

// Investigate states in which there are no followees but there are unfollowed followees
if followed_counter == 0 && unfollowed_counter > 0 && unchanged == 0 {
return Some(format!(
Expand All @@ -234,12 +232,10 @@ fn log_line(
));
}

debug!(
Some(format!(
"Pubkey {}: date {}, {} followed, {} unfollowed, {} unchanged, first seen: {}",
follower, timestamp_diff, followed_counter, unfollowed_counter, unchanged, first_seen
);

None
))
}

fn convert_timestamp(timestamp: u64) -> Result<DateTime<Utc>> {
Expand Down

0 comments on commit 177f55e

Please sign in to comment.