From cf63a58a6349e4072f7576a207ca7cdfff1b09cd Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 14 Aug 2022 15:34:00 -0300 Subject: [PATCH] guild.mod: make execute prune blockable on prune result --- litecord/blueprints/guild/mod.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litecord/blueprints/guild/mod.py b/litecord/blueprints/guild/mod.py index fd8d16c..4a255e8 100644 --- a/litecord/blueprints/guild/mod.py +++ b/litecord/blueprints/guild/mod.py @@ -201,5 +201,8 @@ async def begin_guild_prune(guild_id): days = j["days"] member_ids = await get_prune(guild_id, days) - app.sched.spawn(prune_members(user_id, guild_id, member_ids)) + # TODO move this job to the background scheduler in a way + # that the test can fetch the job and wait on it before + # asserting test result state + await prune_members(user_id, guild_id, member_ids) return jsonify({"pruned": len(member_ids)})