Update speedyf/process.py

This commit is contained in:
Fred Boniface 2024-04-30 21:41:17 +01:00
parent 2464c9bf7c
commit 780606ab2b
1 changed files with 6 additions and 3 deletions

View File

@ -4,10 +4,13 @@ from subprocess import run
semaphore = asyncio.Semaphore(2) semaphore = asyncio.Semaphore(2)
async def process_pdf(file_path, ctx): def generate_cmd(opts):
return "cmd"
async def process_pdf(ctx, file_path, opts):
async with semaphore: async with semaphore:
# Set status to runnin # Set status to running
cmd = "cmd" cmd = generate_cmd(opts)
process = await asyncio.create_subprocess_exec(cmd) process = await asyncio.create_subprocess_exec(cmd)
await process.await() await process.await()
# Set status to done. # Set status to done.