Incr. Server State Validtiy to 90s

By default, healthCheck() is run every 5s. On background tabs, this may get extended. My tests have shown pings every 60s. The ping was older than 10s, so the condition in line 490 evaluates to `false` and the client tries to access the stream before the server is ready. By increasing the validity this can be avoided - at least until the browser runs the healthcheck even less often.

See https://discord.com/channels/1014774730907209781/1041811939380178964/1041812021018120262 for the analysis.
This commit is contained in:
JeLuF 2022-11-14 23:18:03 +01:00 committed by GitHub
parent 0ebfbca93e
commit 288e8a65f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -444,7 +444,7 @@ async function doMakeImage(task) {
const RETRY_DELAY_IF_BUFFER_IS_EMPTY = 1000 // ms
const RETRY_DELAY_IF_SERVER_IS_BUSY = 30 * 1000 // ms, status_code 503, already a task running
const TASK_START_DELAY_ON_SERVER = 1500 // ms
const SERVER_STATE_VALIDITY_DURATION = 10 * 1000 // ms
const SERVER_STATE_VALIDITY_DURATION = 90 * 1000 // ms
const reqBody = task.reqBody
const batchCount = task.batchCount