executor work

This commit is contained in:
John Smith
2022-06-27 23:46:29 -04:00
parent ebea72c9db
commit fdbb4c6397
59 changed files with 726 additions and 640 deletions

View File

@@ -82,7 +82,7 @@ impl Bucket {
.iter()
.map(|(k, v)| (k.clone(), v.clone()))
.collect();
let cur_ts = get_timestamp();
let cur_ts = intf::get_timestamp();
sorted_entries.sort_by(|a, b| -> core::cmp::Ordering {
if a.0 == b.0 {
return core::cmp::Ordering::Equal;

View File

@@ -418,7 +418,7 @@ pub struct BucketEntry {
impl BucketEntry {
pub(super) fn new() -> Self {
let now = get_timestamp();
let now = intf::get_timestamp();
Self {
ref_count: AtomicU32::new(0),
inner: RwLock::new(BucketEntryInner {

View File

@@ -89,7 +89,7 @@ impl RoutingTable {
pub fn debug_info_entries(&self, limit: usize, min_state: BucketEntryState) -> String {
let inner = self.inner.read();
let cur_ts = get_timestamp();
let cur_ts = intf::get_timestamp();
let mut out = String::new();
@@ -148,7 +148,7 @@ impl RoutingTable {
pub fn debug_info_buckets(&self, min_state: BucketEntryState) -> String {
let inner = self.inner.read();
let cur_ts = get_timestamp();
let cur_ts = intf::get_timestamp();
let mut out = String::new();
const COLS: usize = 16;

View File

@@ -1,7 +1,6 @@
use super::*;
use crate::dht::*;
use crate::intf::*;
use crate::xx::*;
use crate::*;
@@ -219,7 +218,7 @@ impl RoutingTable {
F: FnMut(DHTKey, Option<Arc<BucketEntry>>) -> bool,
T: FnMut(DHTKey, Option<Arc<BucketEntry>>) -> O,
{
let cur_ts = get_timestamp();
let cur_ts = intf::get_timestamp();
let out = self.find_peers_with_sort_and_filter(
node_count,
cur_ts,
@@ -301,7 +300,7 @@ impl RoutingTable {
T: FnMut(DHTKey, Option<Arc<BucketEntry>>) -> O,
F: FnMut(DHTKey, Option<Arc<BucketEntry>>) -> bool,
{
let cur_ts = get_timestamp();
let cur_ts = intf::get_timestamp();
let node_count = {
let c = self.config.get();
c.network.dht.max_find_node_count as usize

View File

@@ -7,7 +7,6 @@ mod stats_accounting;
mod tasks;
use crate::dht::*;
use crate::intf::*;
use crate::network_manager::*;
use crate::rpc_processor::*;
use crate::xx::*;

View File

@@ -369,9 +369,7 @@ impl RoutingTable {
Self::with_entries(&*inner, cur_ts, BucketEntryState::Unreliable, |k, v| {
if v.with(|e| e.needs_ping(&k, cur_ts, relay_node_id)) {
let nr = NodeRef::new(self.clone(), k, v, None);
unord.push(MustJoinHandle::new(intf::spawn_local(
rpc.clone().rpc_call_status(nr),
)));
unord.push(intf::spawn_local(rpc.clone().rpc_call_status(nr)));
}
Option::<()>::None
});