feat: made the export processes asyncronous
This commit is contained in:
parent
16e74356d4
commit
f72ed78b60
1 changed files with 10 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue