Skip to content
Snippets Groups Projects
Unverified Commit 7980213d authored by Luc Everse's avatar Luc Everse :passport_control:
Browse files

Unbox timeout integer

parent 5364c908
Branches
Tags
2 merge requests!148Release 2.3.0,!137Worker timeout
......@@ -155,7 +155,7 @@ public class JobSplitter {
logger.debug("Loaded job configuration {}", this.gson.toJson(config));
final Instant endTime;
if (timeout.equals(0)) {
if (timeout == 0) {
endTime = Instant.MAX;
} else {
endTime = Instant.now().plusSeconds(timeout);
......@@ -240,19 +240,19 @@ public class JobSplitter {
}
/**
* Returns the job ID in the message.
* Returns the job timeout in the message.
*
* @param message the message to get the ID from
* @param message the message to get the timeout from
*
* @return the job's timeout
*
* @throws BadJobException if the message contains no ID
* @throws BadJobException if the message contains no timeout
*/
private Integer getJobTimeout(final Message message) {
private int getJobTimeout(final Message message) {
@Nullable
final var timeout = message.getTimeout();
if (timeout == null) {
throw new BadJobException("Job has no identifier");
throw new BadJobException("Job has no timeout");
}
return timeout;
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment