Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDCISA-13736, SDCISA-13746] Fix YAGNI error handling in Scheduler.java #556

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,17 @@

ExpiryCheckHandler.updateServerTimestampHeader(request);

vertx.eventBus().request(redisquesAddress, buildEnqueueOperation("scheduler-" + name, request.toJsonObject().put(QueueClient.QUEUE_TIMESTAMP, System.currentTimeMillis()).encode()),
(Handler<AsyncResult<Message<JsonObject>>>) event -> {
if (!OK.equals(event.result().body().getString(STATUS))) {
log.error("Could not enqueue request {}", request.toJsonObject().encodePrettily());
}
});
String queueName = "scheduler-" + name;
JsonObject enqueOp = buildEnqueueOperation(queueName, request.toJsonObject().put(QueueClient.QUEUE_TIMESTAMP, System.currentTimeMillis()).encode());
vertx.eventBus().request(redisquesAddress, enqueOp, (Handler<AsyncResult<Message<JsonObject>>>) event -> {

Check warning on line 142 in gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java

View check run for this annotation

Codecov / codecov/patch

gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java#L140-L142

Added lines #L140 - L142 were not covered by tests
if (event.failed()) {
if (log.isWarnEnabled()) log.warn("Could not enqueue request '{}' '{}'", queueName, request.getUri(), new Exception(event.cause()));
return;

Check warning on line 145 in gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java

View check run for this annotation

Codecov / codecov/patch

gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java#L145

Added line #L145 was not covered by tests
}
if (!OK.equals(event.result().body().getString(STATUS))) {
log.error("Could not enqueue request {}", request.toJsonObject().encodePrettily());

Check warning on line 148 in gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java

View check run for this annotation

Codecov / codecov/patch

gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java#L148

Added line #L148 was not covered by tests
}
});

Check warning on line 150 in gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java

View check run for this annotation

Codecov / codecov/patch

gateleen-scheduler/src/main/java/org/swisspush/gateleen/scheduler/Scheduler.java#L150

Added line #L150 was not covered by tests
}
}

Expand Down
Loading