From e6efaf3a0666cb31b9fcc507ea5863eedb8dddd9 Mon Sep 17 00:00:00 2001 From: Xyon Date: Sun, 20 Oct 2024 16:51:06 +0100 Subject: [PATCH] drop the fucking mutex lock on the fucking userobject info BEFORE sitting and doing fucking nothing for 300 fucking seconds like a fucking idiot --- src/badgey/commands/ranks.rs | 3 +++ src/badgey/models/xp.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/badgey/commands/ranks.rs b/src/badgey/commands/ranks.rs index b3d3018..0be378e 100644 --- a/src/badgey/commands/ranks.rs +++ b/src/badgey/commands/ranks.rs @@ -163,6 +163,9 @@ async fn leaderboard(ctx: ManifoldContext<'_>) -> ManifoldResult<()> { return Ok(()) } + // Release our mutex lock on this object before the paginate call to avoid holding a lock on it for the full paginate interaction listener timeout duration + drop(userinfo); + manifold::helpers::paginate(ctx, reply_handle, pages, 0).await?; Ok(()) diff --git a/src/badgey/models/xp.rs b/src/badgey/models/xp.rs index 4bc7283..612d3b7 100644 --- a/src/badgey/models/xp.rs +++ b/src/badgey/models/xp.rs @@ -10,7 +10,7 @@ use manifold::error::{ManifoldError, ManifoldResult}; use manifold::models::user::UserInfo; use manifold::schema::userinfo; use poise::FrameworkContext; -use poise::serenity_prelude::{Context, Mention, Mentionable, Message, RoleId, UserId}; +use poise::serenity_prelude::{Context, Mentionable, Message, RoleId}; use crate::badgey::models::quarantine_channel::QuarantineChannel; use crate::badgey::schema::xp as xp_table; use crate::badgey::schema::*; -- 2.30.2