Skip to content

Commit

Permalink
properly parse beamline
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Dec 12, 2023
1 parent e86ccfa commit 8f2996a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ func insertData(sname string, rec Record) error {
path = "/tmp"
}
}
// log record just in case we need to debug it
log.Printf("cycle=%v beamline=%v btr=%v sample=%v", rec["Cycle"], rec["Beamline"], rec["BTR"], rec["SampleName"])
if v, ok := rec["Cycle"]; ok {
cycle = v.(string)
} else {
Expand All @@ -213,6 +215,12 @@ func insertData(sname string, rec Record) error {
beamline = b
case []string:
beamline = strings.Join(b, "-")
case []any:
var values []string
for _, v := range b {
values = append(values, fmt.Sprintf("%v", v))
}
beamline = strings.Join(values, "-")
}
} else {
beamline = fmt.Sprintf("beamline-%s", randomString())
Expand Down

0 comments on commit 8f2996a

Please sign in to comment.