mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
preserve watches
This commit is contained in:
parent
14dc402356
commit
019cb5fd79
@ -354,7 +354,12 @@ impl StorageManagerInner {
|
|||||||
|
|
||||||
// Write open record
|
// Write open record
|
||||||
self.opened_records
|
self.opened_records
|
||||||
.insert(key, OpenedRecord::new(writer, safety_selection));
|
.entry(key)
|
||||||
|
.and_modify(|e| {
|
||||||
|
e.set_writer(writer);
|
||||||
|
e.set_safety_selection(safety_selection);
|
||||||
|
})
|
||||||
|
.or_insert_with(|| OpenedRecord::new(writer, safety_selection));
|
||||||
|
|
||||||
// Make DHT Record Descriptor to return
|
// Make DHT Record Descriptor to return
|
||||||
let descriptor = DHTRecordDescriptor::new(key, owner, owner_secret, schema);
|
let descriptor = DHTRecordDescriptor::new(key, owner, owner_secret, schema);
|
||||||
|
@ -42,16 +42,16 @@ impl OpenedRecord {
|
|||||||
pub fn writer(&self) -> Option<&KeyPair> {
|
pub fn writer(&self) -> Option<&KeyPair> {
|
||||||
self.writer.as_ref()
|
self.writer.as_ref()
|
||||||
}
|
}
|
||||||
// pub fn set_writer(&mut self, writer: Option<KeyPair>) {
|
pub fn set_writer(&mut self, writer: Option<KeyPair>) {
|
||||||
// self.writer = writer;
|
self.writer = writer;
|
||||||
// }
|
}
|
||||||
|
|
||||||
pub fn safety_selection(&self) -> SafetySelection {
|
pub fn safety_selection(&self) -> SafetySelection {
|
||||||
self.safety_selection
|
self.safety_selection
|
||||||
}
|
}
|
||||||
// pub fn set_safety_selection(&mut self, safety_selection: SafetySelection) {
|
pub fn set_safety_selection(&mut self, safety_selection: SafetySelection) {
|
||||||
// self.safety_selection = safety_selection;
|
self.safety_selection = safety_selection;
|
||||||
// }
|
}
|
||||||
|
|
||||||
pub fn set_active_watch(&mut self, active_watch: ActiveWatch) {
|
pub fn set_active_watch(&mut self, active_watch: ActiveWatch) {
|
||||||
self.active_watch = Some(active_watch);
|
self.active_watch = Some(active_watch);
|
||||||
|
Loading…
Reference in New Issue
Block a user