SPB Git forge

spb/hfmarketdata

Public

Open high-frequency market data platform — FirstRate full-history downloader, DuckDB/Parquet lake, open REST API and React docs platform (www.hfmarketdata.io)

127commits 1branches 0releases
24.7 MBsize
maindefault branch
11 days agolast push
JavaScript 53.7% Python 38.3% CSS 4.6% TypeScript 3.1%

stream: compteur d'audit des lignes tenu même avec un charger enregistré

Simon-Pierre Boucher committed 20 days ago (Sep 5, 2026) parent 2915767

1 changed file +6 −2

modified hfmarketdata/api/stream/accounting.py +6 −2
@@ -32,9 +32,13 @@ def get_charger() -> Charger | None:
32 32
33 33
34 34 def charge(principal: str, rows: int = REDUCED_RATE_ROWS_PER_MESSAGE) -> None:
35 + """Charge `rows` to the principal: through the registered charger (rate-limit quota) when present,
36 + and always in the per-day audit counter `stream:rows:{principal}:{day}` (24 h TTL)."""
35 37 if _charger is not None:
36 − _charger(principal, rows)
37 − return
38 + try:
39 + _charger(principal, rows)
40 + except Exception:
41 + pass
38 42 try:
39 43 from .broker import get_redis
40 44 r = get_redis()
41 45