Unverified Commit 8e1d0aa6 authored by vercel-fleet-prod[bot]'s avatar vercel-fleet-prod[bot] Committed by GitHub

turbo-tasks-fs: schedule new watcher paths without extending the batch

New paths open a batch if none is pending, so their watches get restored
by the normal flush, but never push back an existing deadline: in
non-recursive mode every untracked child created in a watched directory
is reported. This replaces the immediate-flush special case.
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent 55710381
...@@ -65,6 +65,14 @@ impl BatchSchedule { ...@@ -65,6 +65,14 @@ impl BatchSchedule {
} }
} }
/// Opens a new batch that closes after `delay` if there isn't one pending. Unlike
/// [`Self::extend`], this never pushes back the deadline of a pending batch.
pub fn ensure_pending(&mut self, delay: Duration) {
if self.pending.is_none() {
self.extend(delay);
}
}
/// Waits for the next watcher event, emitting [`FilesystemSettlingEvent`]s while the pending /// Waits for the next watcher event, emitting [`FilesystemSettlingEvent`]s while the pending
/// batch keeps growing. If no batch is pending, this blocks until an event arrives. /// batch keeps growing. If no batch is pending, this blocks until an event arrives.
/// ///
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment