kopia lustrzana https://github.com/c9/core
fix VFS cache race condition causing VFS conneciton to never be cleaned up.
rodzic
9b9a9f52b1
commit
4a72d312d8
|
@ -5,7 +5,6 @@ define(function(require, exports, module) {
|
||||||
main.provides = ["vfs.cache"];
|
main.provides = ["vfs.cache"];
|
||||||
return main;
|
return main;
|
||||||
|
|
||||||
|
|
||||||
function main(options, imports, register) {
|
function main(options, imports, register) {
|
||||||
var Plugin = imports.Plugin;
|
var Plugin = imports.Plugin;
|
||||||
var connectVfs = imports["vfs.connect"].connect;
|
var connectVfs = imports["vfs.connect"].connect;
|
||||||
|
@ -58,6 +57,7 @@ define(function(require, exports, module) {
|
||||||
entry.emit("loaded");
|
entry.emit("loaded");
|
||||||
|
|
||||||
cache[vfsid] = entry;
|
cache[vfsid] = entry;
|
||||||
|
entry.keepalive();
|
||||||
|
|
||||||
vfs.on("destroy", function() {
|
vfs.on("destroy", function() {
|
||||||
remove(vfsid);
|
remove(vfsid);
|
||||||
|
@ -126,7 +126,6 @@ define(function(require, exports, module) {
|
||||||
};
|
};
|
||||||
|
|
||||||
entry.keepalive = function() {
|
entry.keepalive = function() {
|
||||||
clearTimeout(timer);
|
|
||||||
startTimer();
|
startTimer();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -139,7 +138,6 @@ define(function(require, exports, module) {
|
||||||
}, maxAge);
|
}, maxAge);
|
||||||
}
|
}
|
||||||
|
|
||||||
startTimer();
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue