From a13485671328bf69d4e2731a42a6931f5ed74973 Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Wed, 20 Nov 2024 23:50:55 -0800 Subject: [PATCH] Exclude storage/archive --- app/sync/S3Syncer.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/sync/S3Syncer.mjs b/app/sync/S3Syncer.mjs index 70e375f..ca98fad 100644 --- a/app/sync/S3Syncer.mjs +++ b/app/sync/S3Syncer.mjs @@ -12,7 +12,9 @@ export default class S3Syncer this.syncClient.sync(this.publicBucket, `${this.localPath}/dist`, { filters: this.filters, }), - this.syncClient.sync(this.privateBucket, `${this.localPath}/storage`), + this.syncClient.sync(this.privateBucket, `${this.localPath}/storage`, { + filters: this.privateFilters + }), ]); } @@ -30,7 +32,9 @@ export default class S3Syncer : undefined, }), }), - this.syncClient.sync(`${this.localPath}/storage`, this.privateBucket), + this.syncClient.sync(`${this.localPath}/storage`, this.privateBucket, { + filters: this.privateFilters, + }), ]); } @@ -72,6 +76,12 @@ export default class S3Syncer ]; } + get privateFilters() { + return [ + { exclude: (key) => key.startsWith('archive/') }, + ]; + } + log(message) { console.log(`[S3] ${message}`); }