Skip to content

Commit

Permalink
MLPAB-2408 tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
acsauk committed Oct 16, 2024
1 parent 61ba9f2 commit d82d538
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ set-uploads-infected: ##@events calls emit-object-tags-added-with-virus for all
key=$$k $(MAKE) emit-object-tags-added-with-virus ; \
done

tail-logs: ##@app tails logs for app mock-notify, events-lambda, schedule-runner-lambda, mock-onelogin, mock-lpa-store and mock-uid and filters out noisy runner logs
docker compose --ansi=always -f docker/docker-compose.yml -f docker/docker-compose.dev.yml logs app mock-notify events-lambda schedule-runner-lambda mock-onelogin mock-lpa-store mock-uid -f | grep -v 'runner'
tail-logs: ##@app tails logs for app mock-notify, events-lambda, schedule-runner-lambda, mock-onelogin, mock-lpa-store and mock-uid
docker compose --ansi=always -f docker/docker-compose.yml -f docker/docker-compose.dev.yml logs app mock-notify events-lambda schedule-runner-lambda mock-onelogin mock-lpa-store mock-uid -f

terraform-update-docs: ##@terraform updates all terraform-docs managed documentation
terraform-docs --config terraform/environment/.terraform-docs.yml ./terraform/environment
Expand Down
2 changes: 1 addition & 1 deletion docker/schedule-runner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ WORKDIR /app
COPY --link docker/install_lambda_insights.sh /app/

RUN chmod +x "/app/install_lambda_insights.sh" \
&& /app/install_lambda_insights.sh ${TARGETPLATFORM}
&& /app/install_lambda_insights.sh "${TARGETPLATFORM}"

COPY --from=build /app/schedule-runner ./schedule-runner
COPY --link lang ./lang
Expand Down
4 changes: 1 addition & 3 deletions internal/scheduled/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ func (r *Runner) Run(ctx context.Context) error {
if errors.Is(err, dynamo.NotFoundError{}) {
r.logger.InfoContext(ctx, "no scheduled tasks to process")
return nil
} else if errors.Is(err, dynamo.MultipleResultsError{}) {
continue
} else if err != nil {
r.logger.ErrorContext(ctx, "error getting scheduled task:", slog.Any("err", err))
r.logger.ErrorContext(ctx, "error getting scheduled task", slog.Any("err", err))

if err := r.waiter.Wait(); err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions internal/scheduled/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestRunnerRun(t *testing.T) {
func TestRunnerRunWhenStepErrors(t *testing.T) {
logger := newMockLogger(t)
logger.EXPECT().
ErrorContext(ctx, "error getting scheduled task:", slog.Any("err", expectedError))
ErrorContext(ctx, "error getting scheduled task", slog.Any("err", expectedError))

store := newMockScheduledStore(t)
store.EXPECT().
Expand Down Expand Up @@ -248,7 +248,7 @@ func TestRunnerRunWhenWaitingError(t *testing.T) {
logger.EXPECT().
InfoContext(ctx, "runner action", slog.String("action", "Action(99)"))
logger.EXPECT().
ErrorContext(ctx, "error getting scheduled task:", slog.Any("err", waitingError))
ErrorContext(ctx, "error getting scheduled task", slog.Any("err", waitingError))
logger.EXPECT().
InfoContext(ctx, "runner action success",
slog.String("action", "Action(99)"),
Expand Down Expand Up @@ -300,7 +300,7 @@ func TestRunnerRunWhenConditionalCheckFailsAndWaiterErrors(t *testing.T) {

logger := newMockLogger(t)
logger.EXPECT().
ErrorContext(ctx, "error getting scheduled task:", slog.Any("err", dynamo.ConditionalCheckFailedError{}))
ErrorContext(ctx, "error getting scheduled task", slog.Any("err", dynamo.ConditionalCheckFailedError{}))

runner := &Runner{
now: testNowFn,
Expand Down

0 comments on commit d82d538

Please sign in to comment.