Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/routes/io/io.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import io
import time
import asyncio
import puremagic
from typing import Annotated
from typing import Annotated,Optional
from fastapi import (
APIRouter,
File,
UploadFile,
Form,
Request
Request,
HTTPException
)
from models.responses import *
from foss42.text.slugify import slugify
Expand All @@ -21,8 +23,11 @@ async def delayed_request(wait: int = 5):
try:
if wait > 120:
raise bad_request_400(msg="Delay cannot be more than 120 secs")
time.sleep(wait)
await asyncio.sleep(wait)
return ok_200(f"Waited for {wait} seconds")

except HTTPException:
raise
except Exception as e:
raise internal_error_500()

Expand Down