Skip to content

Commit 7255846

Browse files
committed
chore: address review comments
1 parent 82c30f4 commit 7255846

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

controlplane/src/core/blobstorage/dual.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export class DualBlobStorage implements BlobStorage {
2323
}
2424

2525
async getObject(data: { key: string; abortSignal?: AbortSignal }): Promise<BlobObject> {
26-
try {
27-
return await this.primary.getObject(data);
28-
} catch {
29-
return await this.secondary.getObject(data);
30-
}
26+
return await Promise.any([this.primary.getObject(data), this.secondary.getObject(data)]);
3127
}
3228

3329
async removeDirectory(data: { key: string; abortSignal?: AbortSignal }): Promise<number> {

controlplane/src/core/env.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export const envVariables = z
167167
*/
168168
S3_FAILOVER_STORAGE_URL: z.string().optional(),
169169
S3_FAILOVER_ENDPOINT: z.string().optional(),
170-
S3_FAILOVER_REGION: z.string().optional(),
170+
S3_FAILOVER_REGION: z.string().default('auto'),
171171
S3_FAILOVER_ACCESS_KEY_ID: z.string().optional(),
172172
S3_FAILOVER_SECRET_ACCESS_KEY: z.string().optional(),
173173
S3_FAILOVER_FORCE_PATH_STYLE: z

0 commit comments

Comments
 (0)