From 811eb98d7f00612b4db9c8f60d3d73930f4368eb Mon Sep 17 00:00:00 2001
From: Fabian Wachsmann <k204210@l40243.lvt.dkrz.de>
Date: Thu, 27 Feb 2025 08:32:32 +0100
Subject: [PATCH] Use to_thread

---
 cloudify/plugins/kerchunk.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cloudify/plugins/kerchunk.py b/cloudify/plugins/kerchunk.py
index aa7d4db..18ef500 100755
--- a/cloudify/plugins/kerchunk.py
+++ b/cloudify/plugins/kerchunk.py
@@ -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"
-- 
GitLab