Merge pull request #12993 from overleaf/jpa-configurable-request-threshold

[spelling] make ASpellWorkerPool.MAX_REQUESTS configurable via env var

GitOrigin-RevId: babedafb16b05f53ba0fefc73250bcf623ec4f89
This commit is contained in:
Jakob Ackermann 2023-05-08 14:40:37 +01:00 committed by Copybot
parent 0940437772
commit 480148bf1c
2 changed files with 5 additions and 1 deletions

View file

@ -8,6 +8,7 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
import _ from 'underscore'
import Settings from '@overleaf/settings'
import logger from '@overleaf/logger'
import metrics from '@overleaf/metrics'
import OError from '@overleaf/o-error'
@ -15,7 +16,7 @@ import { ASpellWorker } from './ASpellWorker.js'
export class ASpellWorkerPool {
static initClass() {
this.prototype.MAX_REQUESTS = 100 * 1024
this.prototype.MAX_REQUESTS = Settings.maxRequestsPerWorker
this.prototype.MAX_WORKERS = 32
this.prototype.MAX_IDLE_TIME = 1000
this.prototype.MAX_REQUEST_TIME = 60 * 1000

View file

@ -8,6 +8,9 @@ module.exports = {
},
},
maxRequestsPerWorker:
parseInt(process.env.MAX_REQUESTS_PER_WORKER, 10) || 100 * 1024,
cacheDir: Path.resolve('cache'),
healthCheckUserId: '53c64d2fd68c8d000010bb5f',