mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-11-25 10:10:41 -06:00
preserve watches
This commit is contained in:
parent
14dc402356
commit
019cb5fd79
@ -354,7 +354,12 @@ impl StorageManagerInner {
|
||||
|
||||
// Write open record
|
||||
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
|
||||
let descriptor = DHTRecordDescriptor::new(key, owner, owner_secret, schema);
|
||||
|
@ -42,16 +42,16 @@ impl OpenedRecord {
|
||||
pub fn writer(&self) -> Option<&KeyPair> {
|
||||
self.writer.as_ref()
|
||||
}
|
||||
// pub fn set_writer(&mut self, writer: Option<KeyPair>) {
|
||||
// self.writer = writer;
|
||||
// }
|
||||
pub fn set_writer(&mut self, writer: Option<KeyPair>) {
|
||||
self.writer = writer;
|
||||
}
|
||||
|
||||
pub fn safety_selection(&self) -> SafetySelection {
|
||||
self.safety_selection
|
||||
}
|
||||
// pub fn set_safety_selection(&mut self, safety_selection: SafetySelection) {
|
||||
// self.safety_selection = safety_selection;
|
||||
// }
|
||||
pub fn set_safety_selection(&mut self, safety_selection: SafetySelection) {
|
||||
self.safety_selection = safety_selection;
|
||||
}
|
||||
|
||||
pub fn set_active_watch(&mut self, active_watch: ActiveWatch) {
|
||||
self.active_watch = Some(active_watch);
|
||||
|
Loading…
Reference in New Issue
Block a user