diff options
author | 2023-01-27 03:53:01 -0800 | |
---|---|---|
committer | 2023-01-27 03:53:01 -0800 | |
commit | ddca89f425e72dfdd8afa75a3a1d5b473cc2cc65 (patch) | |
tree | c9906ab93d7a1b4f6221fea76ac5d723134ae1b1 /src/watcher.zig | |
parent | 805e87eeb6a2c77a35c779f6d50cdbf49291f988 (diff) | |
download | bun-ddca89f425e72dfdd8afa75a3a1d5b473cc2cc65.tar.gz bun-ddca89f425e72dfdd8afa75a3a1d5b473cc2cc65.tar.zst bun-ddca89f425e72dfdd8afa75a3a1d5b473cc2cc65.zip |
🪦
Diffstat (limited to '')
-rw-r--r-- | src/watcher.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/watcher.zig b/src/watcher.zig index 5f02652d2..954bd0aa3 100644 --- a/src/watcher.zig +++ b/src/watcher.zig @@ -108,10 +108,15 @@ pub const INotify = struct { std.os.inotify_rm_watch(inotify_fd, wd); } + var coalesce_interval: usize = 100_000; pub fn init() !void { std.debug.assert(!loaded_inotify); loaded_inotify = true; + if (std.os.getenvZ("BUN_INOTIFY_COALESCE_INTERVAL")) |env| { + coalesce_interval = std.fmt.parseInt(usize, env, 10) catch 100_000; + } + inotify_fd = try std.os.inotify_init1(IN_CLOEXEC); } @@ -140,7 +145,7 @@ pub const INotify = struct { .events = std.os.POLL.IN | std.os.POLL.ERR, .revents = 0, }}; - var timespec = std.os.timespec{ .tv_sec = 0, .tv_nsec = 100_000 }; + var timespec = std.os.timespec{ .tv_sec = 0, .tv_nsec = coalesce_interval }; if ((std.os.ppoll(&fds, ×pec, null) catch 0) > 0) { while (true) { const new_rc = std.os.system.read( |