Skip to content

fix: Missing rate limiting on BookDB contribute/consensus functions #222

Description

@deucebucket

Bug

Two BookDB/Skaldleita API functions lack rate limiting:

  1. contribute_to_bookdb() (bookdb.py ~line 488) — POSTs to Skaldleita without calling rate_limit_wait('bookdb'). Checks circuit breaker but has no per-call pacing.
  2. lookup_community_consensus() (bookdb.py ~line 568) — GETs from Skaldleita with NO rate limiting AND no circuit breaker check.

While these are called per-book (not in tight loops), they bypass the 3.6s bookdb pacing that all other BookDB functions respect.

Fix

Add rate_limit_wait('bookdb') to both functions. Add is_circuit_open('bookdb') check to lookup_community_consensus().

Severity

Medium — indirect protection from pipeline batch delays, but direct protection is missing.

Found via code audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions