fix(work): fence repeated approval intents and audit state changes atomically
This commit is contained in:
@@ -45,7 +45,7 @@ class ApprovalWorker:
|
||||
async def call(self,method,*args):
|
||||
allowed={'create','status','consume','cancel','decide','card_material','claim_card',
|
||||
'bind_card','card_send_unknown','close_unavailable','closed_card_receipt',
|
||||
'mark_card_closed','cards_to_send','cards_to_close'}
|
||||
'mark_card_closed','cards_to_send','cards_to_close','maintain_retention'}
|
||||
if method not in allowed:raise ApprovalError('unsupported_approval_operation')
|
||||
try:await asyncio.wait_for(self.slots.acquire(),timeout=.05)
|
||||
except asyncio.TimeoutError:raise ApprovalError('approval_temporarily_unavailable')from None
|
||||
|
||||
Reference in New Issue
Block a user