fix: a busy Tiny retries the whole delivery instead of sending the order without its seller
Some checks failed
Build and deploy / Validate source (push) Successful in 9s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-27 12:33:39 -03:00
parent b027bb5013
commit 6a8855504f
2 changed files with 12 additions and 1 deletions

View File

@@ -873,6 +873,9 @@ class TinyOrders:
failed reading leaves the order without one: it must still go."""
try:
seller = (self.request('GET', f'/contatos/{contact_id}').get('vendedor') or {}).get('id')
except TinyRateLimit:
# Busy for a moment: the whole delivery is tried again, the seller with it.
raise
except TinyError as exc:
logging.warning('Tiny: could not read the seller of contact %s: %s', contact_id, exc)
return None