From 9159e70ac6da03fa614f138f951315df9ece999d Mon Sep 17 00:00:00 2001 From: Cody Born Date: Sat, 30 Nov 2024 18:10:54 +0900 Subject: [PATCH] Do not use the S3 client in the injector --- lib/handlers/hard-quote/injector.ts | 6 +----- lib/handlers/quote/injector.ts | 6 +----- lib/providers/circuit-breaker/dynamo.ts | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/handlers/hard-quote/injector.ts b/lib/handlers/hard-quote/injector.ts index 43a0197..89240ae 100644 --- a/lib/handlers/hard-quote/injector.ts +++ b/lib/handlers/hard-quote/injector.ts @@ -42,11 +42,7 @@ export class QuoteInjector extends ApiInjector { + if (this.fillerEndpoints.length === 0) { + this.fillerEndpoints = this.webhookProvider.fillerEndpoints(); + this.lastUpdatedTimestamp = Date.now(); + } + return this.fillerEndpoints; + } + async getConfigurations(): Promise { if ( - this.fillerEndpoints.length === 0 || + (await this.getFillerEndpoints()).length === 0 || Date.now() - this.lastUpdatedTimestamp > DynamoCircuitBreakerConfigurationProvider.UPDATE_PERIOD_MS ) { await this.fetchConfigurations(); @@ -44,7 +53,7 @@ export class DynamoCircuitBreakerConfigurationProvider implements CircuitBreaker } async fetchConfigurations(): Promise { - this.timestamps = await this.timestampDB.getFillerTimestampsMap(this.fillerEndpoints); + this.timestamps = await this.timestampDB.getFillerTimestampsMap(await this.getFillerEndpoints()); } /* add filler to `enabled` array if it's not blocked until a future timestamp;