Skip to content

Commit

Permalink
#30367 Improved events handling in RealTimeJobMonitor and improvement…
Browse files Browse the repository at this point in the history
…s in transaction handling on the JobQueueManagerAPIImpl
  • Loading branch information
jgambarios committed Nov 18, 2024
1 parent 2e6040b commit db8fcb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ public JobPaginatedResult getFailedJobs(int page, int pageSize) throws DotDataEx
}
}

@WrapInTransaction
@Override
public void cancelJob(final String jobId) throws DotDataException {

Expand All @@ -404,7 +403,6 @@ public void cancelJob(final String jobId) throws DotDataException {
* @param event The event that triggers the job cancellation request.
*/
@VisibleForTesting
@WrapInTransaction
void onCancelRequestJob(final JobCancelRequestEvent event) {

try {
Expand Down Expand Up @@ -505,7 +503,6 @@ private JobState getJobState(final String jobId) throws DotDataException {
* @param progressTracker The processor progress tracker
* @param previousProgress The previous progress value
*/
@WrapInTransaction
private float updateJobProgress(final Job job, final ProgressTracker progressTracker,
final float previousProgress) throws DotDataException {

Expand Down Expand Up @@ -865,7 +862,6 @@ private void handleJobCompletion(final Job job, final JobProcessor processor)
*
* @param job The job to cancel.
*/
@WrapInTransaction
private void handleJobCancelRequest(final Job job) throws DotDataException {

Job cancelJob = job.withState(JobState.CANCEL_REQUESTED);
Expand All @@ -881,7 +877,6 @@ private void handleJobCancelRequest(final Job job) throws DotDataException {
* @param job The job that was canceled.
* @param processor The processor that handled the job.
*/
@WrapInTransaction
private void handleJobCancelling(final Job job, final JobProcessor processor) {

try {
Expand Down Expand Up @@ -981,7 +976,6 @@ private void handleJobFailure(final Job job, final JobProcessor processor,
* @param job The job to update.
* @throws DotDataException if there's an error updating the job status.
*/
@WrapInTransaction
private void updateJobStatus(final Job job) throws DotDataException {
try {
jobQueue.updateJobStatus(job);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Consumer;
import java.util.function.Predicate;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;

/**
Expand Down Expand Up @@ -69,6 +70,11 @@ public class RealTimeJobMonitor {
private final Map<String, List<JobWatcher>> jobWatchers = new ConcurrentHashMap<>();

public RealTimeJobMonitor() {
// Default constructor required for CDI
}

@PostConstruct
protected void init() {

APILocator.getLocalSystemEventsAPI().subscribe(
JobProgressUpdatedEvent.class,
Expand Down

0 comments on commit db8fcb6

Please sign in to comment.