Skip to content
Snippets Groups Projects

Changed pims_analyzer to report failure/success based on if there were failed splits or not

Merged Nathan Bockisch requested to merge fix-pims-workflow-status-reporting into main
1 file
+ 8
5
Compare changes
  • Side-by-side
  • Inline
@@ -58,7 +58,6 @@ type PimsInfo struct {
// database
type workflowEntry struct {
arguments []byte
state string
resultsDir string
}
@@ -111,8 +110,12 @@ func GetPimsInfo(workflowId int, capoPath string, capoProfile string) PimsInfo {
strings.Replace(capoProfile, "dsoc-", "vlass_", -1),
pimsInfo.Calibration,
)
pimsInfo.StatusMsg = fmt.Sprintf("PIMS Split workflow completed with state: %s",
wfEntry.state,
// Workflow reported as failed when there are failed splits
status := "succeeded"
if (pimsInfo.NumFailedSplits != 0) { status = "failed" }
pimsInfo.StatusMsg = fmt.Sprintf("PIMS Split workflow %s!",
status,
)
// Check if there's a Restored MS Path
@@ -163,7 +166,7 @@ func GetPimsInfo(workflowId int, capoPath string, capoProfile string) PimsInfo {
func getWorkflowColumns(workflowId int, dbConnection *sql.DB) (workflowEntry, error) {
workflowTable := "workflow_requests"
workflowIdKey := "workflow_request_id"
dataCols := "argument,state,results_dir"
dataCols := "argument,results_dir"
var entry workflowEntry
// var tmpArgs string // Must get JSON as string first
@@ -177,7 +180,7 @@ func getWorkflowColumns(workflowId int, dbConnection *sql.DB) (workflowEntry, er
workflowTable,
workflowIdKey,
workflowId),
).Scan(&entry.arguments, &entry.state, &entry.resultsDir)
).Scan(&entry.arguments, &entry.resultsDir)
return entry, err
}
Loading