@@ -386,7 +386,7 @@ func AddAttachment(ctx *context.Context) {
if attachment.DatasetID != 0 {
if strings.HasSuffix(attachment.Name, ".zip") {
if typeCloudBrain == models.TypeCloudBrainOne {
err = worker.SendDecompressTask(contexExt.Background(), uuid)
err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name )
if err != nil {
log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error())
} else {
@@ -406,6 +406,13 @@ func AddAttachment(ctx *context.Context) {
})
}
func isCanDecompress(name string) bool {
if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") {
return true
}
return false
}
func UpdateAttachmentDecompressState(ctx *context.Context) {
uuid := ctx.Query("uuid")
result := ctx.Query("result")
@@ -768,7 +775,7 @@ func CompleteMultipart(ctx *context.Context) {
if attachment.DatasetID != 0 {
if strings.HasSuffix(attachment.Name, ".zip") {
if typeCloudBrain == models.TypeCloudBrainOne {
err = worker.SendDecompressTask(contexExt.Background(), uuid)
err = worker.SendDecompressTask(contexExt.Background(), uuid, attachment.Name )
if err != nil {
log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error())
} else {
@@ -838,7 +845,7 @@ func HandleUnDecompressAttachment() {
}
for _, attach := range attachs {
err = worker.SendDecompressTask(contexExt.Background(), attach.UUID)
err = worker.SendDecompressTask(contexExt.Background(), attach.UUID, attach.Name )
if err != nil {
log.Error("SendDecompressTask(%s) failed:%s", attach.UUID, err.Error())
} else {