# fs: Fix unwatching causing \`os\` unwatch dispatch for recursively watched directories \(\#56796\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f511076cdbbe7a1acb01431dc35efc8f87ad6abf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f511076cdbbe7a1acb01431dc35efc8f87ad6abf

Requested commit: f511076cdbbe7a1acb01431dc35efc8f87ad6abf

Commit: f511076cdbbe7a1acb01431dc35efc8f87ad6abf

Tree: 286ce34654da2790b6da1c3994eea3d7d102ea33

Author: Ben Kunkle

Committer: GitHub

## Message

```
fs: Fix unwatching causing `os` unwatch dispatch for recursively watched directories (#56796)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes https://github.com/zed-industries/zed/issues/55746

Release Notes:

- Fixed an issue where file system events or language server events that
resulted in Zed unwatching many paths would result in high CPU usage
```

## Parents

- [37f6d7a15cc2a2b5000a7b146a1c2d5b32f1fb47](https://git.cafe/gitcafe/zed/commit/37f6d7a15cc2a2b5000a7b146a1c2d5b32f1fb47?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f511076cdbbe7a1acb01431dc35efc8f87ad6abf?format=markdown)
