Skip to content

Commit f712734

Browse files
Fix nbconvert handler (#545)
1 parent c0a67e4 commit f712734

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_server/services/nbconvert/handlers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import json
2+
import asyncio
23

34
from anyio.to_thread import run_sync
45
from tornado import web
56

67
from ...base.handlers import APIHandler
78

89

10+
LOCK = asyncio.Lock()
11+
912
class NbconvertRootHandler(APIHandler):
1013

1114
@web.authenticated
@@ -20,7 +23,8 @@ async def get(self):
2023
exporters = await run_sync(base.get_export_names)
2124
for exporter_name in exporters:
2225
try:
23-
exporter_class = await run_sync(base.get_exporter, exporter_name)
26+
async with LOCK:
27+
exporter_class = await run_sync(base.get_exporter, exporter_name)
2428
except ValueError:
2529
# I think the only way this will happen is if the entrypoint
2630
# is uninstalled while this method is running

0 commit comments

Comments
 (0)