remove _user_locks
@@ -34,14 +34,6 @@ class Econ(commands.Cog):
):
command._max_concurrency = self.max_concurrency_dummy._max_concurrency
- self._user_locks = defaultdict(asyncio.Lock)
-
- async def lock_author(self, ctx):
- await self._user_locks[ctx.author.id].acquire()
-
- async def unlock_author(self, ctx):
- self._user_locks[ctx.author.id].release()
-
@functools.lru_cache(maxsize=None) # calculate chances for a specific pickaxe to find emeralds
def calc_yield_chance_list(self, pickaxe: str):
yield_ = self.d.mining.yields_pickaxes[pickaxe] # [xTrue, xFalse]
@@ -810,8 +802,6 @@ class Econ(commands.Cog):
)
@commands.command(name="give", aliases=["gift", "share", "gib"])
- @commands.before_invoke(lock_author)
- @commands.after_invoke(unlock_author)
@commands.guild_only()
# @commands.cooldown(1, 10, commands.BucketType.user)
@commands.max_concurrency(1, commands.BucketType.user)
@@ -829,7 +819,6 @@ class Econ(commands.Cog):
await self.bot.reply_embed(ctx, ctx.l.econ.give.stupid_1)
return
- async with self._user_locks[user.id]:
amount_item = amount_item.lower()
try:
# to be given is emeralds
@@ -1181,7 +1170,6 @@ class Econ(commands.Cog):
await self.bot.reply_embed(ctx, ctx.l.econ.pillage.stupid_2)
return
- async with self._user_locks[victim.id]:
db_user = await self.db.fetch_user(ctx.author.id)
if db_user["emeralds"] < 64:
