diff --git a/lib/egg.js b/lib/egg.js index 7163e6d889..d1fccf3590 100644 --- a/lib/egg.js +++ b/lib/egg.js @@ -3,7 +3,6 @@ const path = require('path'); const fs = require('fs'); const ms = require('ms'); const http = require('http'); -const inspector = require('inspector'); const EggCore = require('egg-core').EggCore; const cluster = require('cluster-client'); const extend = require('extend2'); @@ -115,7 +114,7 @@ class EggApplication extends EggCore { isLeader: this.type === 'agent', logger: this.coreLogger, // debug mode does not check heartbeat - isCheckHeartbeat: inspector.url() === undefined, + isCheckHeartbeat: this.config.env === 'prod' ? true : require('inspector').url() === undefined, }); const client = cluster(clientClass, options); this._patchClusterClient(client);