mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-12-17 16:54:04 -05:00
allow returning local values when offline, even when forcerefresh is turned on
This commit is contained in:
parent
765ecee450
commit
2dee3ff6cc
1 changed files with 4 additions and 0 deletions
|
|
@ -309,6 +309,10 @@ impl StorageManager {
|
||||||
|
|
||||||
// Get rpc processor and drop mutex so we don't block while getting the value from the network
|
// Get rpc processor and drop mutex so we don't block while getting the value from the network
|
||||||
let Some(rpc_processor) = inner.rpc_processor.clone() else {
|
let Some(rpc_processor) = inner.rpc_processor.clone() else {
|
||||||
|
// Return the existing value if we have one if we aren't online
|
||||||
|
if let Some(last_subkey_result_value) = last_subkey_result.value {
|
||||||
|
return Ok(Some(last_subkey_result_value.into_value_data()));
|
||||||
|
}
|
||||||
apibail_try_again!("offline, try again later");
|
apibail_try_again!("offline, try again later");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue