diff --git a/lib/services-loader.js b/lib/services-loader.js index ef61465..625b4cb 100644 --- a/lib/services-loader.js +++ b/lib/services-loader.js @@ -39,7 +39,7 @@ module.exports.create = function (conf, deps) { var fs = PromiseA.promisifyAll(require('fs')); // deps : { memstore, sqlstores, clientSqlFactory, systemSqlFactory } - + // XXX this is a no-no (file system access in a worker, cannot be statically analyzed) // TODO regenerate a static file of all requires on each install // TODO read system config db to find which services auto-start @@ -47,8 +47,11 @@ module.exports.create = function (conf, deps) { return fs.readdirAsync(conf.servicespath).then(function (nodes) { var promise = PromiseA.resolve(); var services = []; - + nodes.forEach(function (node) { + if (!/^\./.test(node)) { + return; + } promise = promise.then(function () { return loadService(node).then(function (srv) { if (!srv) { @@ -90,7 +93,7 @@ module.exports.create = function (conf, deps) { function startServices(services) { var promise = PromiseA.resolve(); var servicesMap = {}; - + services.forEach(function (srv) { promise = promise.then(function () { return startService(srv).then(function (service) { @@ -100,7 +103,7 @@ module.exports.create = function (conf, deps) { } srv.service = service; servicesMap[srv.name] = srv; - }); + }); }); });