Skip to content

Commit

Permalink
Fix nbconvert handler (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Jun 24, 2021
1 parent c0a67e4 commit f712734
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jupyter_server/services/nbconvert/handlers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import json
import asyncio

from anyio.to_thread import run_sync
from tornado import web

from ...base.handlers import APIHandler


LOCK = asyncio.Lock()

class NbconvertRootHandler(APIHandler):

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

0 comments on commit f712734

Please sign in to comment.