Manager: cleanup, rename jobId
to jobID
No functional changes.
This commit is contained in:
parent
634d59e622
commit
e399b14e66
@ -10,12 +10,12 @@ import (
|
|||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (f *Flamenco) FetchJob(e echo.Context, jobId string) error {
|
func (f *Flamenco) FetchJob(e echo.Context, jobID string) error {
|
||||||
logger := requestLogger(e).With().
|
logger := requestLogger(e).With().
|
||||||
Str("job", jobId).
|
Str("job", jobID).
|
||||||
Logger()
|
Logger()
|
||||||
|
|
||||||
if _, err := uuid.Parse(jobId); err != nil {
|
if _, err := uuid.Parse(jobID); err != nil {
|
||||||
logger.Debug().Msg("invalid job ID received")
|
logger.Debug().Msg("invalid job ID received")
|
||||||
return sendAPIError(e, http.StatusBadRequest, "job ID not valid")
|
return sendAPIError(e, http.StatusBadRequest, "job ID not valid")
|
||||||
}
|
}
|
||||||
@ -23,10 +23,10 @@ func (f *Flamenco) FetchJob(e echo.Context, jobId string) error {
|
|||||||
logger.Debug().Msg("fetching job")
|
logger.Debug().Msg("fetching job")
|
||||||
|
|
||||||
ctx := e.Request().Context()
|
ctx := e.Request().Context()
|
||||||
dbJob, err := f.persist.FetchJob(ctx, jobId)
|
dbJob, err := f.persist.FetchJob(ctx, jobID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Warn().Err(err).Msg("cannot fetch job")
|
logger.Warn().Err(err).Msg("cannot fetch job")
|
||||||
return sendAPIError(e, http.StatusNotFound, fmt.Sprintf("job %+v not found", jobId))
|
return sendAPIError(e, http.StatusNotFound, fmt.Sprintf("job %+v not found", jobID))
|
||||||
}
|
}
|
||||||
|
|
||||||
apiJob := jobDBtoAPI(dbJob)
|
apiJob := jobDBtoAPI(dbJob)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user