Skip to content

Commit

Permalink
Cancel watchfiles task at teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 20, 2023
1 parent 60a7aeb commit b70151d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/yjs/fps_yjs/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from asphalt.core import Component, Context
from asphalt.core import Component, Context, context_teardown
from jupyverse_api.app import App
from jupyverse_api.auth import Auth
from jupyverse_api.contents import Contents
Expand All @@ -8,6 +8,7 @@


class YjsComponent(Component):
@context_teardown
async def start(
self,
ctx: Context,
Expand All @@ -20,4 +21,8 @@ async def start(
ctx.add_resource(yjs, types=Yjs)

# start indexing in the background
# contents.file_id_manager
contents.file_id_manager

yield

contents.file_id_manager.watch_files_task.cancel()

0 comments on commit b70151d

Please sign in to comment.