mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-29 22:10:31 +08:00
node: Cache node inventory
For large seeds with many repos, it's expensive to traverse the inventory everytime the node connects to a new peer, for example. To improve the situation, we cache the inventory per `Storage` instance, and add a `refresh` method to refresh the inventory. This method is called when the node is told to synchronize its inventory.
This commit is contained in:
@@ -20,6 +20,7 @@ use radicle::node::address::Store as _;
|
||||
use radicle::node::notifications;
|
||||
use radicle::node::Handle as _;
|
||||
use radicle::profile::Home;
|
||||
use radicle::storage;
|
||||
use radicle::Storage;
|
||||
use radicle::{cob, git};
|
||||
|
||||
@@ -48,6 +49,9 @@ pub enum Error {
|
||||
/// A node database error.
|
||||
#[error("node database error: {0}")]
|
||||
Database(#[from] node::db::Error),
|
||||
/// A storage error.
|
||||
#[error("storage error: {0}")]
|
||||
Storage(#[from] storage::Error),
|
||||
/// A policies database error.
|
||||
#[error("policies database error: {0}")]
|
||||
Policy(#[from] policy::Error),
|
||||
|
||||
Reference in New Issue
Block a user