Permalink
Browse files

FIXED - Now work with node 0.6.x cluster + bumped version

  • Loading branch information...
1 parent e38d2b7 commit a9a93291de8d168577bbde12a33ec3d91bddb437 @glesperance committed Apr 10, 2012
Showing with 24 additions and 11 deletions.
  1. +19 −8 lib/client/client.js
  2. +2 −0 lib/vendors/r.js
  3. +3 −3 package.json
View
@@ -465,10 +465,18 @@ function optimizeDir(dir_path, dst_tmpdir, options_tmpdir, callback) {
'node'
, [rjs_path, '-o', options_file_path]
)
+ , done
;
child.stdout.on('data', function(data) {
process.stdout.write(".");
+
+ //TODO: Replace/remove this hack when node properly supports child processes / VMs inside a cluster worker.
+ if (data + '' === 'DONE\n') {
+ done = true;
+ child.kill();
+ callback(null);
+ }
});
child.stderr.on('data', function(data) {
@@ -480,18 +488,21 @@ function optimizeDir(dir_path, dst_tmpdir, options_tmpdir, callback) {
var error
;
- if (code !== 0) {
+ if (!done) {
+
+ if (code !== 0) {
- error = 'xxx r.js : process exited with code [' + code + ']';
-
- console.log(error);
-
- callback(error)
+ error = 'xxx r.js : process exited with code [' + code + ']';
+
+ console.log(error);
+
+ callback(error)
+
+ }
+ callback(null);
}
- callback(null);
-
});
}
View
@@ -8271,3 +8271,5 @@ function (args, build) {
}((typeof console !== 'undefined' ? console : undefined),
(typeof Packages !== 'undefined' ? Array.prototype.slice.call(arguments, 0) : []),
(typeof readFile !== 'undefined' ? readFile : undefined)));
+
+console.log('DONE');
View
@@ -2,7 +2,7 @@
"name": "rocket"
, "description": "The rapid development framework for node.js"
, "keywords": ["mvc", "model view controller", "comet","rapid development", "Rocket", "framework"]
-, "version": "0.2.3"
+, "version": "0.2.4"
, "homepage": "http://wavo.me"
, "repository":
{ "type" : "git"
@@ -27,8 +27,8 @@
, "oo" : ">= 0.0.3"
, "jade-i18n" : "= 0.0.2"
, "now" : ">= 0.7.4"
- , "colors" : "0.6.x"
- , "gzippo" : "0.1.4"
+ , "colors" : "0.6.x"
+ , "gzippo" : "0.1.4"
}
, "devDependencies": {
}

0 comments on commit a9a9329

Please sign in to comment.