LearnBoost / cluster

Node.JS multi-core server manager with plugins support.

Home Page:http://learnboost.github.com/cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cli error: TypeError: Object #<Master> has no method 'pidof'

alefnula opened this issue · comments

This happens always when I try any cli command. I suspect this is because of the next thing:

pidfiles.js

40 return function(master){
41    dir = master.pidfiles = master.resolve(dir || 'pids');
42    mkdir(dir, 0755, function(err){
43      if (err) throw err;
44
45      // augment master
46      master.pidof = function(name){

I think this is because of the next scenario: When the function mkdir is executed, the function returns so the next plugin (cli) is initialized. So before the mkdir callback starts executing the cli plugin is running, and the pidof function is still not set on the master.

thanks man