Add more sensible process for db write_context testing

This commit is contained in:
onyinyang 2023-11-02 11:01:55 -04:00
parent 66f560eb08
commit 1ed629e233
4 changed files with 23 additions and 9 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -66,7 +66,7 @@ impl LoxServerContext {
let (bridgelines, blocked_bridgelines) =
parse_into_bridgelines(watched_blockages, working_resources);
for bridge in blocked_bridgelines {
let res = self.add_unreachable(bridge);
let res = self.mark_blocked(bridge);
if res {
println!("BridgeLine {:?} successfully marked unreachable", bridge);
self.metrics.blocked_bridges.inc();
@ -109,7 +109,7 @@ impl LoxServerContext {
let (grace_period, failing, blocked) =
sort_for_parsing(watched_blockages, not_working_resources);
for bridge in blocked {
let res = self.add_unreachable(bridge);
let res = self.mark_blocked(bridge);
if res {
println!("BridgeLine {:?} successfully marked unreachable", bridge);
self.metrics.blocked_bridges.inc();

View File

@ -22,11 +22,9 @@ pub fn parse_into_bridgelines(
.get_uid()
.expect("Unable to get Fingerprint UID of resource");
let infostr: String = format!(
"type={} fingerprint={:?} params={:?}",
resource.r#type,
resource.fingerprint,
resource.params,
);
"type={} fingerprint={:?} params={:?}",
resource.r#type, resource.fingerprint, resource.params,
);
let mut info_bytes: [u8; BRIDGE_BYTES - 26] = [0; BRIDGE_BYTES - 26];
info_bytes[..infostr.len()].copy_from_slice(infostr.as_bytes());