[crawler]

This commit is contained in:
LASTA_DEV01\lasta
2026-05-08 17:41:15 +09:00
commit 4158789869
54 changed files with 4355 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
"""Scheduling primitives for recrawls."""

View File

@@ -0,0 +1,11 @@
from __future__ import annotations
from datetime import datetime, timedelta, timezone
def next_crawl_at(policy: dict[str, object] | None, now: datetime | None = None) -> datetime:
now = now or datetime.now(timezone.utc)
policy = policy or {}
interval_days = int(policy.get("interval_days", 7))
return now + timedelta(days=interval_days)