Skip to content

Commit d46d664

Browse files
Download existing docs on server for quicker processing
1 parent 2d72232 commit d46d664

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

lib/s3-sync.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,24 @@ export async function backupExistingFolders() {
5353
}
5454

5555
export async function downloadExistingDocsToLocal() {
56-
// For parallel downloads
57-
return await Promise.all([
58-
/* executeS3Sync({
59-
from: `${apiDocsBucketUrl}/json-docs`,
60-
to: 'tmp/json-docs',
61-
}), */
56+
const promises = [
6257
executeS3Sync({
6358
from: `${apiDocsBucketUrl}/rev-index`,
6459
to: 'tmp/rev-index',
6560
}),
66-
])
61+
]
62+
63+
if (process.env.AWS_SHOULD_PUBLISH === 'yes') {
64+
promises.push(
65+
executeS3Sync({
66+
from: `${apiDocsBucketUrl}/json-docs`,
67+
to: 'tmp/json-docs',
68+
})
69+
)
70+
}
71+
72+
// For parallel downloads
73+
return await Promise.all(promises)
6774
}
6875

6976
export async function uploadDocsToS3() {

0 commit comments

Comments
 (0)