diff --git a/backend/src/db/migrations/20200312140328-bulk_upload_to_s3.js b/backend/src/db/migrations/20200312140328-bulk_upload_to_s3.js index 908c97b42..ee9aba023 100644 --- a/backend/src/db/migrations/20200312140328-bulk_upload_to_s3.js +++ b/backend/src/db/migrations/20200312140328-bulk_upload_to_s3.js @@ -4,6 +4,7 @@ import path from 'path' import { S3 } from 'aws-sdk' import mime from 'mime-types' import { s3Configs } from '../../config' +import https from 'https' export const description = ` Upload all image files to a S3 compatible object storage in order to reduce @@ -14,6 +15,9 @@ export async function up(next) { const driver = getDriver() const session = driver.session() const transaction = session.beginTransaction() + const agent = new https.Agent({ + maxSockets: 5, + }) const { AWS_ENDPOINT: endpoint, @@ -28,7 +32,7 @@ export async function up(next) { return } - const s3 = new S3({ region, endpoint }) + const s3 = new S3({ region, endpoint, httpOptions: { agent } }) try { // Implement your migration here. const { records } = await transaction.run('MATCH (image:Image) RETURN image.url as url')