diff --git a/backend/src/config.ts b/backend/src/config.ts index fed1fdb2..232ef703 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -33,7 +33,9 @@ export default { org: () => process.env.INFLUXDB_ORG ?? 'xl', bucket: () => process.env.INFLUXDB_BUCKET ?? 'ad', token: () => process.env.INFLUXDB_TOKEN, - timeout: () => parseInt(process.env.INFLUXDB_TIMEOUT_MS ?? '20500'), - isFlushEnabled: () => process.env.INFLUXDB_FLUSH_ENABLED === 'true' ?? false + timeout: () => parseInt(process.env.INFLUXDB_TIMEOUT_MS ?? '3500'), + isFlushEnabled: () => + process.env.INFLUXDB_FLUSH_ENABLED === 'true' ?? false, + maxRetries: () => parseInt(process.env.INFLUXDB_MAX_RETRIES ?? '3') } } diff --git a/backend/src/utils/persistence.ts b/backend/src/utils/persistence.ts index 57b42a1c..c840eb03 100644 --- a/backend/src/utils/persistence.ts +++ b/backend/src/utils/persistence.ts @@ -123,7 +123,11 @@ async function initInfluxWriter() { return new InfluxDB({ url: config.influx.url(), - token + token, + timeout: config.influx.timeout(), + writeOptions: { + maxRetries: config.influx.maxRetries() + } }).getWriteApi(config.influx.org(), config.influx.bucket()) }