feat: made the export processes asyncronous

This commit is contained in:
Seaswimmer 2023-08-11 15:58:14 -04:00
parent 16e74356d4
commit f72ed78b60
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -39,7 +39,11 @@ class ExportChannels(commands.Cog):
'--fuck_russia', 'true', '--fuck_russia', 'true',
] ]
os.chdir(self.bundled_data_path) 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 = [ args = [
'dotnet', 'dotnet',
'DiscordChatExporter.Cli.dll', 'DiscordChatExporter.Cli.dll',
@ -53,7 +57,11 @@ class ExportChannels(commands.Cog):
'--fuck_russia', 'true', '--fuck_russia', 'true',
] ]
os.chdir(self.bundled_data_path) 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() @commands.group()
@checks.is_owner() @checks.is_owner()