| 2879 | * @param {ManagedMissing} capturedMissing captured missing |
| 2880 | */ |
| 2881 | const processCapturedMissing = (capturedMissing) => { |
| 2882 | if (capturedMissing.size === 0) { |
| 2883 | return; |
| 2884 | } |
| 2885 | this._missingExistenceOptimization.optimize(snapshot, capturedMissing); |
| 2886 | for (const path of capturedMissing) { |
| 2887 | const cache = this._fileTimestamps.get(path); |
| 2888 | if (cache !== undefined && !isExistenceOnly(cache)) { |
| 2889 | if (cache !== "ignore") { |
| 2890 | missingExistence.set(path, Boolean(cache)); |
| 2891 | } |
| 2892 | } else { |
| 2893 | jobs++; |
| 2894 | this.fileTimestampQueue.add(path, (err, entry) => { |
| 2895 | if (err) { |
| 2896 | if (this.logger) { |
| 2897 | this.logger.debug( |
| 2898 | `Error snapshotting missing timestamp of ${path}: ${err.stack}` |
| 2899 | ); |
| 2900 | } |
| 2901 | jobError(); |
| 2902 | } else { |
| 2903 | missingExistence.set(path, Boolean(entry)); |
| 2904 | jobDone(); |
| 2905 | } |
| 2906 | }); |
| 2907 | } |
| 2908 | } |
| 2909 | }; |
| 2910 | if (missing) { |
| 2911 | processCapturedMissing(captureNonManaged(missing, managedMissing)); |
| 2912 | } |