File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ const s3Client = new S3Client({});
66
77const backupBucket = process . env . AWS_S3_BACKUP_BUCKET ;
88const backupClient =
9- process . env . AWS_S3_ENDPOINT && process . env . AWS_REGION
9+ process . env . BB_AWS_S3_ENDPOINT && process . env . BB_AWS_REGION
1010 ? new S3Client ( {
11- endpoint : process . env . AWS_S3_ENDPOINT ,
12- region : process . env . AWS_REGION ,
11+ endpoint : process . env . BB_AWS_S3_ENDPOINT ,
12+ region : process . env . BB_AWS_REGION ,
1313 forcePathStyle : true ,
1414 } )
15- : s3Client ;
15+ : null ;
1616
1717function next21Minutedate ( ) {
1818 const dt = new Date ( ) ;
@@ -59,8 +59,8 @@ export async function storeDataset(filename: string, body: string) {
5959}
6060
6161export async function storeBackup ( key : string , body : string | Readable | Buffer ) {
62- if ( ! backupBucket && ! datasetBucket ) {
63- throw new Error ( "No backup bucket configured" ) ;
62+ if ( ! backupBucket && ! backupClient ) {
63+ throw new Error ( "No backup client configured" ) ;
6464 }
6565
6666 const params = {
@@ -70,5 +70,5 @@ export async function storeBackup(key: string, body: string | Readable | Buffer)
7070 } ;
7171
7272 const command = new PutObjectCommand ( params ) ;
73- await backupClient . send ( command ) ;
73+ await backupClient ? .send ( command ) ;
7474}
You can’t perform that action at this time.
0 commit comments