mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge pull request #3375 from Human-Connection/set-maxSockets-to-avoid-rate-limit-error
fix(migration): Set maxSockets to avoid rate limit
This commit is contained in:
commit
f9e5d84779
@ -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')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user