Browse Source

[commands] Correct concurrency never releasing during prepare call

pull/6218/head
Dan Hess 4 years ago
committed by GitHub
parent
commit
faffc8eeb2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      discord/ext/commands/core.py

5
discord/ext/commands/core.py

@ -781,6 +781,7 @@ class Command(_BaseCommand):
if self._max_concurrency is not None: if self._max_concurrency is not None:
await self._max_concurrency.acquire(ctx) await self._max_concurrency.acquire(ctx)
try:
if self.cooldown_after_parsing: if self.cooldown_after_parsing:
await self._parse_arguments(ctx) await self._parse_arguments(ctx)
self._prepare_cooldowns(ctx) self._prepare_cooldowns(ctx)
@ -789,6 +790,10 @@ class Command(_BaseCommand):
await self._parse_arguments(ctx) await self._parse_arguments(ctx)
await self.call_before_hooks(ctx) await self.call_before_hooks(ctx)
except:
if self._max_concurrency is not None:
await self._max_concurrency.release(ctx)
raise
def is_on_cooldown(self, ctx): def is_on_cooldown(self, ctx):
"""Checks whether the command is currently on cooldown. """Checks whether the command is currently on cooldown.

Loading…
Cancel
Save