Skip to content
Snippets Groups Projects
Commit 811eb98d authored by Fabian Wachsmann's avatar Fabian Wachsmann
Browse files

Use to_thread

parent 077b75f4
No related branches found
No related tags found
No related merge requests found
Pipeline #98469 failed
......@@ -28,7 +28,6 @@ GCLIMIT = 500
async def kerchunk_stream_content(data):
await asyncio.sleep(0)
yield data
......@@ -94,8 +93,9 @@ class KerchunkPass(Plugin):
# media_type='application/octet-stream',
# )
else:
data = await asyncio.to_thread(lambda: fsmap[key])
resp = StreamingResponse(
kerchunk_stream_content(fsmap[key]),
kerchunk_stream_content(data),
media_type="application/octet-stream",
)
resp.headers["Cache-control"] = "max-age=604800"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment