threaded
This commit is contained in:
parent
abc74fb307
commit
4640a5b57c
@ -2,6 +2,7 @@ from fastapi import FastAPI, Request
|
|||||||
from fastapi.responses import HTMLResponse, JSONResponse
|
from fastapi.responses import HTMLResponse, JSONResponse
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
|
from fastapi.concurrency import run_in_threadpool
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import app.download as download
|
import app.download as download
|
||||||
import json
|
import json
|
||||||
@ -18,7 +19,7 @@ templates = Jinja2Templates(directory="/app/templates")
|
|||||||
# api
|
# api
|
||||||
@app.get("/dropoutUpdate")
|
@app.get("/dropoutUpdate")
|
||||||
async def dropoutUpdate():
|
async def dropoutUpdate():
|
||||||
download.dropout.series()
|
return await run_in_threadpool(download.dropout.series())
|
||||||
|
|
||||||
@app.get("/dropoutSeries", response_class=JSONResponse)
|
@app.get("/dropoutSeries", response_class=JSONResponse)
|
||||||
async def dropoutSeries():
|
async def dropoutSeries():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user