radicle: separate out the start of ReadOdb
The ReadRepository::contains method can be wasteful since it opens
and ODB handle and immediately closes it, while its usage may reuqire
checking multiple OIDs in a batch, e.g. in the RefsStatus
calculation.
Instead, introduce a ReadOdb trait, an Odb associated type to
ReadRepository, and a new method ReadRepository::odb for getting
the ReadOdb type.
The use of contains in RefsStatus uses the ReadOdb instead to
improve the usage performance.
ReadRepository::contains remains a part of the trait as a follow-up
task.
6 files changed
+80
-22
9cdf0aa1
→
a9a15500
modified flake.lock
@@ -3,11 +3,11 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -23,11 +23,11 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -41,11 +41,11 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -56,11 +56,11 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -89,11 +89,11 @@
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle-node/src/service/message.rs
@@ -2,7 +2,7 @@ use std::{fmt, io, mem};
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -205,21 +205,23 @@ impl RefsStatus {
|
|
|
|
|
|
| + | |
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -247,12 +249,13 @@ impl RefsStatus {
|
|
|
|
|
|
| - | |
| + | |
|
|
| + | |
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
modified radicle/src/storage.rs
@@ -419,8 +419,20 @@ impl<T: ReadRepository> HasRepoId for T {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle/src/storage/git.rs
@@ -29,7 +29,7 @@ pub use crate::git::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -328,6 +328,13 @@ pub struct Repository {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -565,6 +572,12 @@ impl Repository {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -628,6 +641,12 @@ impl ValidateRepository for Repository {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle/src/storage/git/cob.rs
@@ -250,6 +250,14 @@ impl<'a, R: storage::ValidateRepository> ValidateRepository for DraftStore<'a, R
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
modified radicle/src/test/storage.rs
@@ -163,7 +163,23 @@ impl ValidateRepository for MockRepository {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|