Skip to content

Commit

Permalink
Merge pull request #353 from pixlise/feature/em-import
Browse files Browse the repository at this point in the history
EM importer: fixing hk reading
  • Loading branch information
pnemere authored Nov 11, 2024
2 parents 3228489 + 4265fe6 commit ea4a1ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/endpoints/Scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ func PutScanData(params apiRouter.ApiHandlerGenericParams) error {
existing, err := params.Svcs.FS.ListObjects(destBucket, s3PathStart+"/")
if err == nil && len(existing) > 0 {
// Delete all that exists
msg := fmt.Sprintf("PutScan for \"%v\": Deleting existing file...\n", scanId)
msg := fmt.Sprintf("PutScan for \"%v\": Deleting existing file...", scanId)
for _, existingItem := range existing {
msg += existingItem + "\n"
msg += "\n " + existingItem
if err := params.Svcs.FS.DeleteObject(destBucket, existingItem); err != nil {
return fmt.Errorf("Failed to delete: \"%v\", error: %v", existing, err)
}
Expand Down
8 changes: 6 additions & 2 deletions api/ws/handlers/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ func processEM(importId string, zipReader *zip.Reader, zippedData []byte, destBu
return fmt.Errorf("Failed to scan %v for RSI creation: %v", sdfLocalPath, err)
}

logger.Infof("Generated RSI files:")
if len(rtts) > 0 && len(genFiles) != len(rtts)*2 {
return fmt.Errorf("Unexpected file generation count for RSI creation from: %v", sdfLocalPath)
}

logger.Infof("Generated RSI & HK files:")
for _, f := range genFiles {
logger.Infof(" %v", f)
}
Expand All @@ -572,7 +576,7 @@ func processEM(importId string, zipReader *zip.Reader, zippedData []byte, destBu
continue
}

rxlPath, logPath, surfPath, err := createBeamLocation(filepath.Join(localTemp, f), rtts[c], localTemp, logger)
rxlPath, logPath, surfPath, err := createBeamLocation(filepath.Join(localTemp, f), rtts[c/2], localTemp, logger)
if err != nil {
// Don't fail on errors for these - we may have run beam location tool on some incomplete scan, so failure isn't terrible!
logger.Errorf("Beam location generation failed for RSI: %v. Error: %v", f, err)
Expand Down

0 comments on commit ea4a1ff

Please sign in to comment.