Reduced execution amount to 20
This commit is contained in:
@@ -1925,7 +1925,7 @@ func cleanupExecutions(resp http.ResponseWriter, request *http.Request) {
|
|||||||
var workflowExecutions []WorkflowExecution
|
var workflowExecutions []WorkflowExecution
|
||||||
_, err = dbclient.GetAll(ctx, q, &workflowExecutions)
|
_, err = dbclient.GetAll(ctx, q, &workflowExecutions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error getting workflowexec: %s", err)
|
log.Printf("Error getting workflowexec (cleanup): %s", err)
|
||||||
resp.WriteHeader(401)
|
resp.WriteHeader(401)
|
||||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Failed getting all workflowexecutions"}`)))
|
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Failed getting all workflowexecutions"}`)))
|
||||||
return
|
return
|
||||||
@@ -4404,7 +4404,7 @@ func getWorkflowExecutions(resp http.ResponseWriter, request *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Query for the specifci workflowId
|
// Query for the specifci workflowId
|
||||||
q := datastore.NewQuery("workflowexecution").Filter("workflow_id =", fileId).Order("-started_at").Limit(50)
|
q := datastore.NewQuery("workflowexecution").Filter("workflow_id =", fileId).Order("-started_at").Limit(20)
|
||||||
var workflowExecutions []WorkflowExecution
|
var workflowExecutions []WorkflowExecution
|
||||||
_, err = dbclient.GetAll(ctx, q, &workflowExecutions)
|
_, err = dbclient.GetAll(ctx, q, &workflowExecutions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -180,15 +180,20 @@ const Workflows = (props) => {
|
|||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
console.log("Status not 200 for WORKFLOW EXECUTION :O!")
|
console.log("Status not 200 for WORKFLOW EXECUTION :O!")
|
||||||
alert.error("Failed loading executions for current workflow")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.json()
|
return response.json()
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
setWorkflowExecutions(responseJson)
|
if (responseJson.success === true) {
|
||||||
if (responseJson.length > 0) {
|
setWorkflowExecutions(responseJson)
|
||||||
setSelectedExecution(responseJson[0])
|
if (responseJson.length > 0) {
|
||||||
|
setSelectedExecution(responseJson[0])
|
||||||
|
}
|
||||||
|
} else if (!responseJson.success && responseJson.reason !== undefined) {
|
||||||
|
alert.error("Failed loading executions: "+responseJson.reason)
|
||||||
|
} else {
|
||||||
|
alert.error("Failed loading executions for workflow")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|||||||
Reference in New Issue
Block a user