fix: harden events log — non-dict ring entries, off-loop journal reads, no default-config singleton
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+8
-4
@@ -389,10 +389,14 @@ async def start(
|
||||
|
||||
ej = journal_mod.get_events_journal(config)
|
||||
if ej.enabled and ej.journal_path.is_file():
|
||||
events, more = journal_mod.read_events(
|
||||
ej.journal_dir, ej.journal_file,
|
||||
limit=limit, before=before, host=host_f, level=level_f, q=q_f,
|
||||
predicate=visible,
|
||||
# File scan can be large; keep it off the loop that services UDP/WS
|
||||
events, more = await asyncio.get_running_loop().run_in_executor(
|
||||
None,
|
||||
lambda: journal_mod.read_events(
|
||||
ej.journal_dir, ej.journal_file,
|
||||
limit=limit, before=before, host=host_f, level=level_f, q=q_f,
|
||||
predicate=visible,
|
||||
),
|
||||
)
|
||||
else:
|
||||
# Journal disabled or not yet written: serve the in-memory ring
|
||||
|
||||
Reference in New Issue
Block a user