Skip to content

Commit

Permalink
fix after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
duoertai committed Mar 14, 2024
1 parent 88c24e5 commit 1f6d894
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
14 changes: 7 additions & 7 deletions extensions/postgres/non_transactional.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func (d dbSession) UpdateProcessExecutionStatusForVisibility(
}

const selectProcessExecutionsQuery = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND start_time >= $2 AND start_time <= $3
AND (process_execution_id > $4 OR start_time < $5)
Expand Down Expand Up @@ -265,7 +265,7 @@ func (d dbSession) SelectProcessExecutions(
}

const selectProcessExecutionsByStatusQuery = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND status = $2
AND start_time >= $3 AND start_time <= $4
Expand Down Expand Up @@ -300,7 +300,7 @@ func (d dbSession) SelectProcessExecutionsByStatus(
}

const selectProcessExecutionsByTypeQuery = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND process_type_name = $2
AND start_time >= $3 AND start_time <= $4
Expand Down Expand Up @@ -335,7 +335,7 @@ func (d dbSession) SelectProcessExecutionsByTypeQuery(
}

const selectProcessExecutionsByIdQuery = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND process_id = $2
AND start_time >= $3 AND start_time <= $4
Expand Down Expand Up @@ -369,7 +369,7 @@ func (d dbSession) SelectProcessExecutionsById(
}

const selectProcessExecutionsByStatusAndType = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND status = $2
AND process_type_name = $3
Expand Down Expand Up @@ -407,10 +407,10 @@ func (d dbSession) SelectProcessExecutionsByStatusAndType(
}

const selectProcessExecutionsByStatusAndIdQuery = `SELECT *
FROM executions_visibility
FROM xcherry_sys_executions_visibility
WHERE namespace = $1
AND status = $2
AND process_type_name = $3
AND process_id = $3
AND start_time >= $4 AND start_time <= $5
AND (process_execution_id > $6 OR start_time < $7)
ORDER BY start_time DESC, process_execution_id
Expand Down
1 change: 1 addition & 0 deletions persistence/visibility/visibility_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func (p sqlVisibilityStoreImpl) ListProcessExecutions(

var lastProcessExecutionId string
var lastStartTime int64
lastProcessExecutionId = "00000000-0000-0000-0000-000000000000"
if paginationToken != nil {
lastProcessExecutionId = paginationToken.LastProcessExecutionId
lastStartTime = paginationToken.LastStartTime
Expand Down
2 changes: 1 addition & 1 deletion service/api/gin_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (h *ginHandler) ListProcessExecutions(c *gin.Context) {
h.logger.Debug("responded ListProcessExecutions API request", tag.Value(h.toJson(resp)), tag.Value(h.toJson(errResp)))
}()

//resp, errResp = h.svc.ListProcessExecutions(c.Request.Context(), req)
resp, errResp = h.svc.ListProcessExecutions(c.Request.Context(), req)

if errResp != nil {
c.JSON(errResp.StatusCode, errResp.Error)
Expand Down
2 changes: 2 additions & 0 deletions service/api/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ type Service interface {
Rpc(
ctx context.Context, request xcapi.ProcessExecutionRpcRequest,
) (resp *xcapi.ProcessExecutionRpcResponse, err *ErrorWithStatus)
ListProcessExecutions(ctx context.Context, request xcapi.ListProcessExecutionsRequest,
) (response *xcapi.ListProcessExecutionsResponse, retErr *ErrorWithStatus)
}

0 comments on commit 1f6d894

Please sign in to comment.