Resolve some TODOs
This commit is contained in:
parent
ec4dc5ca29
commit
10ff088b5a
|
@ -52,7 +52,6 @@ pub fn blocked_in(
|
|||
confidence: f64,
|
||||
date: u32,
|
||||
) -> HashSet<String> {
|
||||
// TODO: Re-evaluate past days if we have backdated reports
|
||||
let mut blocked_in = HashSet::<String>::new();
|
||||
let today = date;
|
||||
let age = today - bridge_info.first_seen;
|
||||
|
|
|
@ -25,7 +25,7 @@ pub struct ExtraInfo {
|
|||
/// Map of country codes and how many users (rounded up to a multiple of
|
||||
/// 8) have connected to that bridge during the day.
|
||||
/// Uses BTreeMap instead of HashMap so ExtraInfo can implement Hash.
|
||||
pub bridge_ips: BTreeMap<String, u32>, // TODO: What size for count?
|
||||
pub bridge_ips: BTreeMap<String, u32>,
|
||||
}
|
||||
|
||||
impl ExtraInfo {
|
||||
|
|
|
@ -486,12 +486,10 @@ pub async fn update_negative_reports(db: &Db, distributors: &BTreeMap<BridgeDist
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
// TODO: Would it be cheaper to just recreate it?
|
||||
all_negative_reports.clear();
|
||||
// Remove the now-processed reports from the database
|
||||
db.insert(
|
||||
"nrs-to-process",
|
||||
bincode::serialize(&all_negative_reports).unwrap(),
|
||||
bincode::serialize(&BTreeMap::<String, Vec<SerializableNegativeReport>>::new()).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
@ -601,12 +599,10 @@ pub async fn update_positive_reports(db: &Db, distributors: &BTreeMap<BridgeDist
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
// TODO: Would it be cheaper to just recreate it?
|
||||
all_positive_reports.clear();
|
||||
// Remove the now-processed reports from the database
|
||||
db.insert(
|
||||
"prs-to-process",
|
||||
bincode::serialize(&all_positive_reports).unwrap(),
|
||||
bincode::serialize(&BTreeMap::<String, Vec<SerializablePositiveReport>>::new()).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue