mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-05 06:49:30 +00:00
UBERF-9608 Fix ceph s3 upload (#8209)
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / uitest-workspaces (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / uitest-workspaces (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
a06c0cc5b7
commit
07e9c31902
@ -136,9 +136,8 @@ export async function handleBlobDelete (
|
|||||||
try {
|
try {
|
||||||
await datalake.delete(ctx, workspace, name)
|
await datalake.delete(ctx, workspace, name)
|
||||||
res.status(204).send()
|
res.status(204).send()
|
||||||
} catch (err: any) {
|
} catch (error: any) {
|
||||||
const message = err instanceof Error ? err.message : String(err)
|
ctx.error('failed to delete blob', { error })
|
||||||
ctx.error('failed to delete blob', { message })
|
|
||||||
res.status(500).send()
|
res.status(500).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,9 +154,8 @@ export async function handleBlobDeleteList (
|
|||||||
try {
|
try {
|
||||||
await datalake.delete(ctx, workspace, body.names)
|
await datalake.delete(ctx, workspace, body.names)
|
||||||
res.status(204).send()
|
res.status(204).send()
|
||||||
} catch (err: any) {
|
} catch (error: any) {
|
||||||
const message = err instanceof Error ? err.message : String(err)
|
ctx.error('failed to delete blobs', { error })
|
||||||
ctx.error('failed to delete blobs', { message })
|
|
||||||
res.status(500).send()
|
res.status(500).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -174,9 +172,8 @@ export async function handleBlobSetParent (
|
|||||||
try {
|
try {
|
||||||
await datalake.setParent(ctx, workspace, name, parent)
|
await datalake.setParent(ctx, workspace, name, parent)
|
||||||
res.status(204).send()
|
res.status(204).send()
|
||||||
} catch (err: any) {
|
} catch (error: any) {
|
||||||
const message = err instanceof Error ? err.message : String(err)
|
ctx.error('failed to delete blob', { error })
|
||||||
ctx.error('failed to delete blob', { message })
|
|
||||||
res.status(500).send()
|
res.status(500).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +226,7 @@ export async function handleUploadFormData (
|
|||||||
return { key, metadata }
|
return { key, metadata }
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
const error = err instanceof Error ? err.message : String(err)
|
const error = err instanceof Error ? err.message : String(err)
|
||||||
ctx.error('failed to upload blob', { error })
|
ctx.error('failed to upload blob', { error: err })
|
||||||
return { key, error }
|
return { key, error }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -102,7 +102,7 @@ class S3BucketImpl implements S3Bucket {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.contentLength < 5 * 1024 * 1024) {
|
if (Buffer.isBuffer(body)) {
|
||||||
const result = await ctx.with('s3.putObject', {}, () => this.client.putObject(command))
|
const result = await ctx.with('s3.putObject', {}, () => this.client.putObject(command))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -27,6 +27,7 @@ export interface S3Options {
|
|||||||
|
|
||||||
export function createClient (opt: S3Options): S3 {
|
export function createClient (opt: S3Options): S3 {
|
||||||
return new S3({
|
return new S3({
|
||||||
|
forcePathStyle: true,
|
||||||
endpoint: opt.endpoint,
|
endpoint: opt.endpoint,
|
||||||
credentials: {
|
credentials: {
|
||||||
accessKeyId: opt.accessKey,
|
accessKeyId: opt.accessKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user