fix(kqueue): replace .renamed events with .deleted as they are now equivalent
This commit is contained in:
parent
7171ad1905
commit
b99d0e57a6
3 changed files with 4 additions and 4 deletions
|
|
@ -175,7 +175,7 @@ fn thread_fn(self: *@This(), allocator: std.mem.Allocator) void {
|
|||
// skipped by scan_dir's snapshots.contains() check.
|
||||
self.remove_watch(allocator, dir_path);
|
||||
} else if (ev.fflags & NOTE_RENAME != 0) {
|
||||
self.handler.change(dir_path, EventType.renamed, .dir) catch |e| {
|
||||
self.handler.change(dir_path, EventType.deleted, .dir) catch |e| {
|
||||
std.log.err("nightwatch: handler returned {s}, stopping watch thread", .{@errorName(e)});
|
||||
return;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ fn thread_fn(self: *@This(), allocator: std.mem.Allocator) void {
|
|||
return;
|
||||
};
|
||||
} else if (ev.fflags & NOTE_RENAME != 0) {
|
||||
self.handler.change(watch_path, EventType.renamed, .file) catch |e| {
|
||||
self.handler.change(watch_path, EventType.deleted, .file) catch |e| {
|
||||
std.log.err("nightwatch: handler returned {s}, stopping watch thread", .{@errorName(e)});
|
||||
return;
|
||||
};
|
||||
|
|
@ -156,7 +156,7 @@ fn thread_fn(self: *@This(), allocator: std.mem.Allocator) void {
|
|||
// skipped by scan_dir's snapshots.contains() check.
|
||||
self.remove_watch(allocator, watch_path);
|
||||
} else if (ev.fflags & NOTE_RENAME != 0) {
|
||||
self.handler.change(watch_path, EventType.renamed, .dir) catch |e| {
|
||||
self.handler.change(watch_path, EventType.deleted, .dir) catch |e| {
|
||||
std.log.err("nightwatch: handler returned {s}, stopping watch thread", .{@errorName(e)});
|
||||
return;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub const EventType = enum {
|
|||
/// destination side.
|
||||
///
|
||||
/// - **kqueue / kqueuedir**: when a watched *directory* is itself
|
||||
/// renamed, a `renamed` change event is emitted for the old directory
|
||||
/// renamed, a `deleted` change event is emitted for the old directory
|
||||
/// path (the new path is not known). Renames of *files inside* a
|
||||
/// watched directory are detected indirectly via directory-level
|
||||
/// `NOTE_WRITE` events and appear as `deleted` + `created`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue