mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-02-25 08:51:14 -05:00
seed dht fanout
This commit is contained in:
parent
98786ca827
commit
918cd0de95
@ -43,6 +43,12 @@ impl StorageManager {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get the nodes we know are caching this value to seed the fanout
|
||||||
|
let init_fanout_queue = {
|
||||||
|
let inner = self.inner.lock().await;
|
||||||
|
inner.get_value_nodes(key)?.unwrap_or_default()
|
||||||
|
};
|
||||||
|
|
||||||
// Make do-get-value answer context
|
// Make do-get-value answer context
|
||||||
let schema = if let Some(d) = &last_get_result.opt_descriptor {
|
let schema = if let Some(d) = &last_get_result.opt_descriptor {
|
||||||
Some(d.schema()?)
|
Some(d.schema()?)
|
||||||
@ -179,7 +185,7 @@ impl StorageManager {
|
|||||||
check_done,
|
check_done,
|
||||||
);
|
);
|
||||||
|
|
||||||
let kind = match fanout_call.run(vec![]).await {
|
let kind = match fanout_call.run(init_fanout_queue).await {
|
||||||
// If we don't finish in the timeout (too much time passed checking for consensus)
|
// If we don't finish in the timeout (too much time passed checking for consensus)
|
||||||
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
||||||
// If we finished with or without consensus (enough nodes returning the same value)
|
// If we finished with or without consensus (enough nodes returning the same value)
|
||||||
|
@ -82,6 +82,12 @@ impl StorageManager {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get the nodes we know are caching this value to seed the fanout
|
||||||
|
let init_fanout_queue = {
|
||||||
|
let inner = self.inner.lock().await;
|
||||||
|
inner.get_value_nodes(key)?.unwrap_or_default()
|
||||||
|
};
|
||||||
|
|
||||||
// Make do-inspect-value answer context
|
// Make do-inspect-value answer context
|
||||||
let opt_descriptor_info = if let Some(descriptor) = &local_inspect_result.opt_descriptor {
|
let opt_descriptor_info = if let Some(descriptor) = &local_inspect_result.opt_descriptor {
|
||||||
// Get the descriptor info. This also truncates the subkeys list to what can be returned from the network.
|
// Get the descriptor info. This also truncates the subkeys list to what can be returned from the network.
|
||||||
@ -253,7 +259,7 @@ impl StorageManager {
|
|||||||
check_done,
|
check_done,
|
||||||
);
|
);
|
||||||
|
|
||||||
let kind = match fanout_call.run(vec![]).await {
|
let kind = match fanout_call.run(init_fanout_queue).await {
|
||||||
// If we don't finish in the timeout (too much time passed checking for consensus)
|
// If we don't finish in the timeout (too much time passed checking for consensus)
|
||||||
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
||||||
// If we finished with or without consensus (enough nodes returning the same value)
|
// If we finished with or without consensus (enough nodes returning the same value)
|
||||||
|
@ -44,6 +44,12 @@ impl StorageManager {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get the nodes we know are caching this value to seed the fanout
|
||||||
|
let init_fanout_queue = {
|
||||||
|
let inner = self.inner.lock().await;
|
||||||
|
inner.get_value_nodes(key)?.unwrap_or_default()
|
||||||
|
};
|
||||||
|
|
||||||
// Make do-set-value answer context
|
// Make do-set-value answer context
|
||||||
let schema = descriptor.schema()?;
|
let schema = descriptor.schema()?;
|
||||||
let context = Arc::new(Mutex::new(OutboundSetValueContext {
|
let context = Arc::new(Mutex::new(OutboundSetValueContext {
|
||||||
@ -170,7 +176,7 @@ impl StorageManager {
|
|||||||
check_done,
|
check_done,
|
||||||
);
|
);
|
||||||
|
|
||||||
let kind = match fanout_call.run(vec![]).await {
|
let kind = match fanout_call.run(init_fanout_queue).await {
|
||||||
// If we don't finish in the timeout (too much time passed checking for consensus)
|
// If we don't finish in the timeout (too much time passed checking for consensus)
|
||||||
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
TimeoutOr::Timeout => FanoutResultKind::Timeout,
|
||||||
// If we finished with or without consensus (enough nodes returning the same value)
|
// If we finished with or without consensus (enough nodes returning the same value)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user