Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/storage/io.js

Issue 5713134241185792: Issue 337 - Race condition preventing initialization on first run (Closed)
Patch Set: Created April 16, 2014, 9:45 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/filesystem/io.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/storage/io.js
===================================================================
--- a/lib/storage/io.js
+++ b/lib/storage/io.js
@@ -111,16 +111,19 @@ var IO = exports.IO =
delete ext.storage[path];
delete ext.storage[path + "/lastModified"];
callback(null);
},
statFile: function(file, callback)
{
var path = this._getFilePath(file);
- callback(null, {
+
+ // This needs to use Utils.runAsync(), otherwise FilterStorage might
+ // initialize too early - see #337.
+ require("utils").Utils.runAsync(callback.bind(null, null, {
exists: path in ext.storage,
isDirectory: false,
isFile: true,
lastModified: parseInt(ext.storage[path + "/lastModified"], 10) || 0
- });
+ }));
}
};
« no previous file with comments | « lib/filesystem/io.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld