added toggler to disable toobusy if necessary

v1.18.x
Julian Lam 9 years ago
parent 33f07b82f9
commit 9589de551e

@ -221,7 +221,7 @@ middleware.privateUploads = function(req, res, next) {
};
middleware.busyCheck = function(req, res, next) {
if (global.env === 'production' && toobusy()) {
if (global.env === 'production' && (!meta.config.hasOwnProperty('eventLoopCheckEnabled') || parseInt(meta.config.eventLoopCheckEnabled, 10) === 1) && toobusy()) {
res.type('text/html').sendFile(path.join(__dirname, '../../public/503.html'));
} else {
next();

@ -50,6 +50,12 @@
point.
</p>
<form>
<div class="form-group">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect" for="eventLoopCheckEnabled">
<input class="mdl-switch__input" id="eventLoopCheckEnabled" type="checkbox" data-field="eventLoopCheckEnabled" checked />
<span class="mdl-switch__label">Enable Traffic Management</span>
</label>
</div>
<div class="form-group">
<label for="eventLoopLagThreshold">Event Loop Lag Threshold (in milliseconds)</label>
<input class="form-control" id="eventLoopLagThreshold" type="number" data-field="eventLoopLagThreshold" placeholder="Default: 70" step="10" value="70" />

Loading…
Cancel
Save