fix: log silent errors and fix scan_dir dangling snapshot key
This commit is contained in:
parent
046c304c60
commit
eb42d23fc8
5 changed files with 43 additions and 14 deletions
|
|
@ -220,6 +220,11 @@ fn callback(
|
|||
// a single event. Emit one change call per applicable flag so
|
||||
// callers see all relevant event types (e.g. created + modified).
|
||||
const ot: ObjectType = if (flags & kFSEventStreamEventFlagItemIsDir != 0) .dir else .file;
|
||||
// Handler errors are silently ignored: this callback runs on a GCD
|
||||
// dispatch thread managed by the OS, so there is no way to propagate
|
||||
// an error back to the caller. Stopping the stream from inside the
|
||||
// callback would require a separate signal channel and is not worth
|
||||
// the complexity; the stream will keep delivering future events.
|
||||
if (flags & kFSEventStreamEventFlagItemCreated != 0) {
|
||||
ctx.handler.change(path, .created, ot) catch {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue