mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 21:27:56 +02:00
added toggler to disable toobusy if necessary
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user