Commit 3c91f673 authored by A. Koch's avatar A. Koch

add try catch to uploads

parent 3c9529f1
Pipeline #1117 passed with stage
......@@ -57,11 +57,17 @@ const concatJob = async function (job) {
}
if (!errored) {
const minioClient = new Minio.Client(config.assets.client)
await minioClient.fPutObject(config.assets.bucket, destFile, destination, {'Content-Type': 'video/mp4'})
await minioClient.fPutObject(config.assets.bucket, thumbFile, thumbPath, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileSmall, thumbPathSmall, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileMedium, thumbPathMedium, {'Content-Type': 'image/jpeg'})
try {
const minioClient = new Minio.Client(config.assets.client)
await minioClient.fPutObject(config.assets.bucket, destFile, destination, {'Content-Type': 'video/mp4'})
await minioClient.fPutObject(config.assets.bucket, thumbFile, thumbPath, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileSmall, thumbPathSmall, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileMedium, thumbPathMedium, {'Content-Type': 'image/jpeg'})
}
catch (e) {
captureException(e)
errored = true
}
}
await fs.remove(tmpDir)
......
......@@ -86,11 +86,17 @@ const convertJob = async function (job) {
}
if (!errored) {
const minioClient = new Minio.Client(config.assets.client)
await minioClient.fPutObject(config.assets.bucket, destFile, destination, {'Content-Type': 'video/mp4'})
await minioClient.fPutObject(config.assets.bucket, thumbFile, thumbPath, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileSmall, thumbPathSmall, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileMedium, thumbPathMedium, {'Content-Type': 'image/jpeg'})
try {
const minioClient = new Minio.Client(config.assets.client)
await minioClient.fPutObject(config.assets.bucket, destFile, destination, {'Content-Type': 'video/mp4'})
await minioClient.fPutObject(config.assets.bucket, thumbFile, thumbPath, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileSmall, thumbPathSmall, {'Content-Type': 'image/jpeg'})
await minioClient.fPutObject(config.assets.bucket, thumbFileMedium, thumbPathMedium, {'Content-Type': 'image/jpeg'})
}
catch (e) {
captureException(e)
errored = true
}
}
await fs.remove(tmpDir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment