radicle: Load inventory lazily
Instead of loading the inventory cache on storage open, load it
when the inventory function is called and the list is empty.
I chose not to add an extra flag or Option, which means that if
the storage is actually empty, it’ll be reloaded everytime, but since
loading an empty inventory is basically free, that’s ok.
2 files changed
+29
-35
057af40e
→
6288dd0a
modified radicle-node/src/service.rs
@@ -790,6 +790,7 @@ where
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified radicle/src/storage/git.rs
@@ -89,7 +89,8 @@ impl<'a> TryFrom<git2::Reference<'a>> for Ref {
|
|
|
|
|
|
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -116,24 +117,31 @@ impl ReadStorage for Storage {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -178,14 +186,11 @@ impl Storage {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
@@ -306,24 +311,12 @@ impl Storage {
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
|
|
|
|
|