MCPcopy
hub / github.com/thinkjs/thinkjs / runInMaster

Method runInMaster

lib/application.js:128–137  ·  view source on GitHub ↗

* run in master

(argv)

Source from the content-addressed store, hash-verified

126 * run in master
127 */
128 runInMaster(argv) {
129 return think.beforeStartServer().catch(err => {
130 think.logger.error(err);
131 }).then(() => {
132 const instance = this._getMasterInstance(argv);
133 return instance.startServer();
134 }).then(() => {
135 think.app.emit('appReady');
136 });
137 }
138 _getWorkerInstance(argv) {
139 const port = argv.port || think.config('port');
140 const instance = new thinkCluster.Worker({

Callers 1

runMethod · 0.95

Calls 4

_getMasterInstanceMethod · 0.95
beforeStartServerMethod · 0.80
errorMethod · 0.80
startServerMethod · 0.45

Tested by

no test coverage detected