Update.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
FROM python:3.12-alpine
|
||||
FROM python:3.12-slim
|
||||
|
||||
RUN apk add git
|
||||
RUN apt update && apt install --no-install-recommends -y git gifsicle libgl1
|
||||
WORKDIR /code
|
||||
RUN git clone https://gitea.typename.fr/mikael.capelle/advent-of-code .
|
||||
RUN pip install -e .
|
||||
|
@@ -67,13 +67,21 @@ async def file(name: str):
|
||||
|
||||
|
||||
@app.post("/submit-sse")
|
||||
async def submit_sse(year: int = Form(), day: int = Form(), input: str = Form()):
|
||||
async def submit_sse(
|
||||
year: int = Form(), day: int = Form(), input: str = Form(), verbose: bool = Form()
|
||||
):
|
||||
data = input.rstrip().replace("\r\n", "\n")
|
||||
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
args = [
|
||||
"holt59-aoc",
|
||||
"--stdin",
|
||||
"--api",
|
||||
]
|
||||
if verbose:
|
||||
args.append("--verbose")
|
||||
|
||||
process = await asyncio.create_subprocess_exec(
|
||||
*args,
|
||||
"--output",
|
||||
AOC_FILES_PATH,
|
||||
"--year",
|
||||
@@ -97,6 +105,10 @@ async def submit_sse(year: int = Form(), day: int = Form(), input: str = Form())
|
||||
output = await fp.readline()
|
||||
if output == b"":
|
||||
break
|
||||
|
||||
if stream == "stderr" and output.startswith(b"OpenCV: FFMPEG"):
|
||||
continue
|
||||
|
||||
await message_queue.put(
|
||||
{
|
||||
"type": "stream",
|
||||
|
Reference in New Issue
Block a user