From f72ed78b603b36b3bbcdc12c68038a4b8a465318 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 11 Aug 2023 15:58:14 -0400 Subject: [PATCH] feat: made the export processes asyncronous --- exportchannels/exportchannels.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/exportchannels/exportchannels.py b/exportchannels/exportchannels.py index 3f5d2c4..9e4bac0 100644 --- a/exportchannels/exportchannels.py +++ b/exportchannels/exportchannels.py @@ -39,7 +39,11 @@ class ExportChannels(commands.Cog): '--fuck_russia', 'true', ] os.chdir(self.bundled_data_path) - subprocess.call(args) + process_1 = await asyncio.create_subprocess_exec(*args) + while True: + return_code_1 = process_1.poll() + if return_code_1 is not None: + break args = [ 'dotnet', 'DiscordChatExporter.Cli.dll', @@ -53,7 +57,11 @@ class ExportChannels(commands.Cog): '--fuck_russia', 'true', ] os.chdir(self.bundled_data_path) - subprocess.call(args) + process_2 = await asyncio.create_subprocess_exec(*args) + while True: + return_code_2 = process_2.poll() + if return_code_2 is not None: + break @commands.group() @checks.is_owner()