[commands] Correct concurrency never releasing during prepare call
This commit is contained in:
parent
ef67b56fc6
commit
faffc8eeb2
@ -781,14 +781,19 @@ 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)
|
||||||
|
|
||||||
if self.cooldown_after_parsing:
|
try:
|
||||||
await self._parse_arguments(ctx)
|
if self.cooldown_after_parsing:
|
||||||
self._prepare_cooldowns(ctx)
|
await self._parse_arguments(ctx)
|
||||||
else:
|
self._prepare_cooldowns(ctx)
|
||||||
self._prepare_cooldowns(ctx)
|
else:
|
||||||
await self._parse_arguments(ctx)
|
self._prepare_cooldowns(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…
x
Reference in New Issue
Block a user