SpeedyF/speedyf/process.py

17 lines
405 B
Python
Raw Normal View History

2024-04-30 21:16:03 +01:00
import asyncio
from functools import partial
from subprocess import run
semaphore = asyncio.Semaphore(2)
2024-04-30 21:41:17 +01:00
def generate_cmd(opts):
return "cmd"
async def process_pdf(ctx, file_path, opts):
2024-04-30 21:16:03 +01:00
async with semaphore:
2024-04-30 21:41:17 +01:00
# Set status to running
cmd = generate_cmd(opts)
2024-04-30 21:16:03 +01:00
process = await asyncio.create_subprocess_exec(cmd)
await process.await()
# Set status to done.