lib/core.js
function(next) {
            try { process.umask(core.umask); } catch(e) { logger.error("umask:", core.umask, e) }

            // Create all subfolders with permissions, run it before initializing db which may create files in the spool folder
            if (!cluster.isWorker && !core.worker) {
                Object.keys(core.path).forEach(function(p) {
                    var paths = Array.isArray(core.path[p]) ? core.path[p] : [core.path[p]];
                    paths.forEach(function(x) {
                        if (!x || path.isAbsolute(x)) return;
                        lib.mkdirSync(x);
                        lib.chownSync(this.uid, this.gid, x);
                    });
                });
            }
            next();
        }
function(next) {
            try { process.umask(core.umask); } catch(e) { logger.error("umask:", core.umask, e) }

            // Create all subfolders with permissions, run it before initializing db which may create files in the spool folder
            if (!cluster.isWorker && !core.worker) {
                Object.keys(core.path).forEach(function(p) {
                    var paths = Array.isArray(core.path[p]) ? core.path[p] : [core.path[p]];
                    paths.forEach(function(x) {
                        if (!x || path.isAbsolute(x)) return;
                        lib.mkdirSync(x);
                        lib.chownSync(this.uid, this.gid, x);
                    });
                });
            }
            next();
        }
function ( next ) { try { process . umask ( core . umask ) ; } catch ( e ) { logger . error ( "umask:" , core . umask , e ) } // Create all subfolders with permissions, run it before initializing db which may create files in the spool folder if ( ! cluster . isWorker && ! core . worker ) { Object . keys ( core . path ) . forEach ( function ( p ) { var paths = Array . isArray ( core . path [ p ] ) ? core . path [ p ] : [ core . path [ p ] ] ; paths . forEach ( function ( x ) { if ( ! x || path . isAbsolute ( x ) ) return ; lib . mkdirSync ( x ) ; lib . chownSync ( this . uid , this . gid , x ) ; } ) ; } ) ; } next ( ) ; }
Create all directories, only master should do it once but we resolve absolute paths in any mode
Create all directories only master should do it once but we resolve absolute paths in any mode