Skip to content

Commit

Permalink
Added registration of a FAILED resume job
Browse files Browse the repository at this point in the history
Signed-off-by: coduz <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Mar 21, 2020
1 parent 0ba0336 commit 57a9ea3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019 Eurotech and/or its affiliates and others
* Copyright (c) 2019, 2020 Eurotech and/or its affiliates and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand All @@ -22,11 +22,22 @@ public enum QueuedJobExecutionStatus {
* The {@link QueuedJobExecution} has been enqueued and it is waiting to be resumed.
* <p>
* This is the initial status in which a newly created {@link QueuedJobExecution} should be in.
*
* @since 1.1.0
*/
QUEUED,

/**
* The {@link QueuedJobExecution} has been resumed and fired.
*
* @since 1.1.0
*/
PROCESSED
PROCESSED,

/**
* The {@link QueuedJobExecution} has failed to resume.
*
* @since 1.2.0
*/
FAILED_TO_RESUME
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public void run() {
} catch (Exception e) {
LOG.error("Resuming Job Execution ({}/{}): {}... ERROR!", i, queuedJobExecutions.getSize(), qje.getJobExecutionId(), e);
failedToResumeExecution++;

qje.setStatus(QueuedJobExecutionStatus.FAILED_TO_RESUME);
KapuaSecurityUtils.doPrivileged(() -> QUEUED_JOB_EXECUTION_SERVICE.update(qje));
continue;
}

Expand Down

0 comments on commit 57a9ea3

Please sign in to comment.