Skip to content

Commit

Permalink
Merge pull request #194 from pixlise/feature/v4-post-release-fixes
Browse files Browse the repository at this point in the history
Fixing EM uploads where data zip is uploaded again, and 2 zips are fo…
  • Loading branch information
pnemere authored Mar 26, 2024
2 parents 5cae72e + e3d7f29 commit d5bdcce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion api/dataimport/internal/converters/pixlem/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package pixlem

import (
"errors"
"fmt"
"os"
"path/filepath"

Expand All @@ -44,7 +45,7 @@ func (p PIXLEM) Import(importPath string, pseudoIntensityRangesPath string, data
if entry.IsDir() {
// If it's not the first one, we can't do this
if len(subdir) > 0 {
return nil, "", errors.New("Found multiple subdirs, expected one in: " + importPath)
return nil, "", fmt.Errorf("Found multiple subdirs (\"%v\", \"%v\"), expected one in: \"%v\"", subdir, entry.Name(), importPath)
}
subdir = entry.Name()
}
Expand Down
17 changes: 10 additions & 7 deletions api/ws/handlers/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,16 @@ func HandleScanUploadReq(req *protos.ScanUploadReq, hctx wsHelpers.HandlerContex
return nil, fmt.Errorf("Zip file missing RFS sub-directory")
}

// Save the contents as a zip file in the uploads area
savePath := path.Join(s3PathStart, "data.zip")
err = fs.WriteObject(destBucket, savePath, zippedData)
if err != nil {
return nil, err
}
logger.Infof(" Wrote: s3://%v/%v", destBucket, savePath)
// NOTE: we just downloaded the zip from here, no point uploading it again!
/*
// Save the contents as a zip file in the uploads area
savePath := path.Join(s3PathStart, "data.zip")
err = fs.WriteObject(destBucket, savePath, zippedData)
if err != nil {
return nil, err
}
logger.Infof(" Wrote: s3://%v/%v", destBucket, savePath)
*/
} else {
// Expecting flat zip of MSA files
count := 0
Expand Down

0 comments on commit d5bdcce

Please sign in to comment.