Merge pull request #251 from mozilla/rfk/max-lag-config
Configurable max_lag for dev-vs-prod
This commit is contained in:
Коммит
786922d5ad
|
@ -15,8 +15,8 @@ notifications:
|
|||
skip_join: false
|
||||
|
||||
env:
|
||||
- KVSTORE_BACKEND=mysql
|
||||
- KVSTORE_BACKEND=memory
|
||||
- KVSTORE_BACKEND=mysql TOOBUSY_MAX_LAG=0
|
||||
- KVSTORE_BACKEND=memory TOOBUSY_MAX_LAG=0
|
||||
|
||||
before_script:
|
||||
- "mysql -e 'DROP DATABASE IF EXISTS test;'"
|
||||
|
|
|
@ -221,6 +221,13 @@ module.exports = function (fs, path, url, convict) {
|
|||
default: path.resolve(__dirname, '../templates/email')
|
||||
}
|
||||
},
|
||||
toobusy: {
|
||||
max_lag: {
|
||||
doc: "Max event-loop lag before toobusy reports failure",
|
||||
default: 70,
|
||||
env: 'TOOBUSY_MAX_LAG'
|
||||
}
|
||||
},
|
||||
dev: {
|
||||
verified: {
|
||||
doc: 'new Accounts should start already verified',
|
||||
|
|
|
@ -62,8 +62,12 @@ module.exports = function (path, url, Hapi, toobusy, error) {
|
|||
|
||||
//TODO throttle extension
|
||||
|
||||
// twice the default max lag of 70ms
|
||||
toobusy.maxLag(140)
|
||||
// Enable toobusy, unless it has been preffed off in the config.
|
||||
if (config.toobusy.max_lag > 0) {
|
||||
toobusy.maxLag(config.toobusy.max_lag)
|
||||
} else {
|
||||
toobusy = function() { return false; }
|
||||
}
|
||||
|
||||
server.ext(
|
||||
'onRequest',
|
||||
|
|
Загрузка…
Ссылка в новой задаче