Skip to content

Commit

Permalink
fix: don't require inspector module on production env (#5228)
Browse files Browse the repository at this point in the history
because of production env shouldn't use inspector module and such as vercel/pkg custom node runtime remove it.
so we hope egg disable inspector on production env.

closes #5226
  • Loading branch information
dingiyan committed Jun 25, 2023
1 parent a0ba9c3 commit 398fe15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/egg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 398fe15

Please sign in to comment.