add configurable timeout for note translations

This commit is contained in:
Hazelnoot 2025-05-12 00:23:59 -04:00
parent 00cfeca3d7
commit e7ee2cc398
9 changed files with 66 additions and 3 deletions

View file

@ -116,6 +116,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
Accept: 'application/json, */*',
},
body: params.toString(),
timeout: this.serverSettings.translationTimeout,
});
if (this.serverSettings.deeplAuthKey) {
const json = (await res.json()) as {
@ -165,6 +166,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
format: 'text',
api_key: this.serverSettings.libreTranslateKey ?? '',
}),
timeout: this.serverSettings.translationTimeout,
});
const json = (await res.json()) as {