(argv)
| 103 | return options; |
| 104 | } |
| 105 | _getMasterInstance(argv) { |
| 106 | const port = argv.port || think.config('port'); |
| 107 | const host = think.config('host'); |
| 108 | const instance = new thinkCluster.Master({ |
| 109 | port, |
| 110 | host, |
| 111 | sticky: think.config('stickyCluster'), |
| 112 | getRemoteAddress: socket => { |
| 113 | return socket.remoteAddress || ''; |
| 114 | }, |
| 115 | workers: think.config('workers'), |
| 116 | reloadSignal: think.config('reloadSignal') |
| 117 | }); |
| 118 | this.masterInstance = instance; |
| 119 | think.logger.info(`Server running at http://${host || '127.0.0.1'}:${port}`); |
| 120 | think.logger.info(`ThinkJS version: ${think.version}`); |
| 121 | think.logger.info(`Environment: ${think.app.env}`); |
| 122 | think.logger.info(`Workers: ${instance.options.workers}`); |
| 123 | return instance; |
| 124 | } |
| 125 | /** |
| 126 | * run in master |
| 127 | */ |
no test coverage detected