fix(memory,curator): the leisure plan is not news for the curator
This commit is contained in:
@@ -12,6 +12,7 @@ from beaver_agent.memory.watch import CURATOR_WATCH
|
||||
from beaver_agent.vault import (
|
||||
CURATOR_JOURNAL,
|
||||
DAYS,
|
||||
LEISURE,
|
||||
REPLIES,
|
||||
STATE,
|
||||
STATE_MAX_LINES,
|
||||
@@ -59,6 +60,7 @@ async def curate(run: JobRun) -> None:
|
||||
replies_dir=REPLIES,
|
||||
watched=CURATOR_WATCH,
|
||||
tz=TZ,
|
||||
skip=(LEISURE,),
|
||||
)
|
||||
if text is None:
|
||||
_log.info("curator: nothing new since the last run")
|
||||
|
||||
@@ -96,13 +96,17 @@ def briefing(
|
||||
tz: str,
|
||||
now: datetime | None = None,
|
||||
default_window: timedelta = timedelta(hours=24),
|
||||
skip: tuple[Path, ...] = (),
|
||||
) -> str | None:
|
||||
"""Первое сообщение куратору или ``None``, если с прошлого прогона ничего нет."""
|
||||
now = now or datetime.now(UTC)
|
||||
since = last_run(journal, default=now - default_window)
|
||||
replies = new_replies(replies_dir, since, tz)
|
||||
changed = changed_files(
|
||||
watched, since, vault, skip=(str(journal.relative_to(vault)),)
|
||||
watched,
|
||||
since,
|
||||
vault,
|
||||
skip=tuple(str(p.relative_to(vault)) for p in (journal, *skip)),
|
||||
)
|
||||
if not replies and not changed:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user