fix(drain): msg.metadata is a property, not a method

nats-py's Msg.metadata is a property returning a Metadata object
directly — not an async callable. Removes the erroneous () call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-06-15 21:22:06 +00:00
commit af4d2a3697

View file

@ -687,7 +687,7 @@ class CentralConsumer:
# while we still hold the message (prevents interleaving).
if self._draining:
try:
meta = await msg.metadata()
meta = msg.metadata
if meta is not None and getattr(meta, "num_pending", None) == 0:
self._drain_complete()
except Exception: