pub async fn flush(&self) -> Result<(), ConfigError> {
        let mut setup_rx = self.setup_receiver.clone();
        // TODO once upgraded to tokio 1.27 use wait_until
        while (*setup_rx.borrow()).is_none() {
            // If this fails that means the channel was closed forcefully by the sender
            if setup_rx.changed().await.is_err() {
                return Err(ConfigError::ServerFailedToStart);
            }
        }
        if *setup_rx.borrow() == Some(false) {
            return Err(ConfigError::ServerFailedToStart);
        }

        let (tx, rx) = oneshot::channel();
        self.flush
            .send(WatcherCommand::Flush(tx))
            .map_err(|_| ConfigError::ServerStopped)?;
        rx.await.map_err(|_| ConfigError::ServerStopped)
    }
Await a full filesystem flush from the watcher.
crates/turborepo-globwatch/src/lib.rs