Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/blaxel/core/sandbox/default/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ async def cp(self, source: str, destination: str, max_wait: int = 180000) -> Cop

return CopyResponse(message="Files copied", source=source, destination=destination)

def watch(
async def watch(
self,
path: str,
callback: Callable[[WatchEvent], None],
Expand All @@ -393,7 +393,7 @@ def watch(

Or manually:

handle = sandbox.fs.watch(path, callback)
handle = await sandbox.fs.watch(path, callback)
try:
# do something
finally:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/core/sandbox/test_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def on_change(event):
if event.name == "watched-file.txt":
change_detected = True

handle = self.sandbox.fs.watch(dir_path, on_change)
handle = await self.sandbox.fs.watch(dir_path, on_change)

try:
await async_sleep(0.5)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/core/sandbox/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def on_change(event):
nonlocal change_detected
change_detected = True

handle = sandbox_from_session.fs.watch("/", on_change)
handle = await sandbox_from_session.fs.watch("/", on_change)
try:
await async_sleep(0.5) # Wait for watch to be established
await sandbox_from_session.fs.write("/session-test.txt", "content")
Expand Down
Loading