review: a memory write wakes the Honcho worker
A write, an undo or an accepted write decided into the ledger waited out the worker's 30 s idle sleep. Mirror::journalled now says whether it added a line, and memoryd wakes the worker when it did. The Wake lock is a leaf, taken under the index lock as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -228,9 +228,12 @@ impl Memoryd {
|
||||
|
||||
/// With `[honcho]`: decide journalled edit `id` (the latest when `None`) into the ledger. Called
|
||||
/// under the index lock, so edits are decided in the journal's order (M5c spec, section 4).
|
||||
/// What it decided is sent at once: the worker is woken.
|
||||
fn mirror(&self, id: Option<&str>) {
|
||||
if let Some(mirror) = &self.mirror {
|
||||
mirror.journalled(&self.store, id, Timestamp::now(), &*self.log);
|
||||
if let Some(mirror) = &self.mirror
|
||||
&& mirror.journalled(&self.store, id, Timestamp::now(), &*self.log)
|
||||
{
|
||||
self.wake.notify();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user