Skip to content

Commit

Permalink
Fix SQL query to get children jobs (#29)
Browse files Browse the repository at this point in the history
Also remove some Logger.info instances.
  • Loading branch information
fridim authored Jul 20, 2023
1 parent a38d28a commit 5c1ec7e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
1 change: 0 additions & 1 deletion cmd/sandbox-api/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ func ShortRequestID(next http.Handler) http.Handler {

var err error
requestID, err = gonanoid.New()
log.Logger.Info("Generating new request ID", "requestID", requestID)

if err != nil {
log.Logger.Error("Error generating request ID", "error", err)
Expand Down
9 changes: 1 addition & 8 deletions internal/models/lifecycle_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ func GetLifecyclePlacementJob(dbpool *pgxpool.Pool, id int) (*LifecyclePlacement
func GetLifecyclePlacementJobByRequestID(dbpool *pgxpool.Pool, requestID string) (*LifecyclePlacementJob, error) {
var j LifecyclePlacementJob

log.Logger.Info("sql",
"sql",
"SELECT id, placement_id, status, request, lifecycle_action FROM lifecycle_placement_jobs WHERE request_id = $1",
"requestID",
requestID)

err := dbpool.QueryRow(
context.Background(),
"SELECT id, placement_id, status, request, lifecycle_action FROM lifecycle_placement_jobs WHERE request_id = $1",
Expand Down Expand Up @@ -241,8 +235,7 @@ func (j *LifecyclePlacementJob) GlobalStatus() (string, error) {
rows, err := j.DbPool.Query(
context.TODO(),
`SELECT id FROM lifecycle_resource_jobs
WHERE lifecycle_action = 'status'
AND parent_id = $1
WHERE parent_id = $1
ORDER BY updated_at`,
j.ID,
)
Expand Down

0 comments on commit 5c1ec7e

Please sign in to comment.