From 1d375ffb700aeefe110a4e3a14a2c3f69cded8bb Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 11 Oct 2016 11:23:31 -0400 Subject: [PATCH] Hold off on using optimistic functions in watch.readAndWatchFileWithHash. This partially reverts commit 96c95629eb60711d7466180b78874b1a9c70dd6a. When running `meteor update`, we call writeReleaseFileAndDevBundleLink immediately before reading .meteor/release, so there's no time for a file change notification to invalidate the cached contents of that file. In the future, we could perhaps call optimisticReadFile.dirty(path) as a consequence of files.writeFile(path, ...), but that may be tricky. --- tools/fs/watch.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/fs/watch.js b/tools/fs/watch.js index 21b7a352bd..c7508e9993 100644 --- a/tools/fs/watch.js +++ b/tools/fs/watch.js @@ -7,7 +7,6 @@ import {Profile} from '../tool-env/profile.js'; import { optimisticStatOrNull, - optimisticReadFile, optimisticReaddir, optimisticHashOrNull, } from "./optimistic.js"; @@ -247,7 +246,7 @@ export class WatchSet { export function readFile(absPath) { try { - return optimisticReadFile(absPath); + return files.readFile(absPath); } catch (e) { // Rethrow most errors. if (! e || (e.code !== 'ENOENT' && e.code !== 'EISDIR')) { @@ -732,7 +731,7 @@ export function readAndWatchFileWithHash(watchSet, absPath) { // context where we might not always have a WatchSet (eg, reading // settings.json where we watch for "meteor run" but not for "meteor deploy"). if (watchSet) { - hash = optimisticHashOrNull(absPath); + hash = contents === null ? null : sha1(contents); watchSet.addFile(absPath, hash); }