Skip to content

Commit 9abafb0

Browse files
Merge branch 'issue-30552-containers-tm-support' of https://github.com/dotCMS/core into issue-30552-containers-tm-support
2 parents 4af94ab + 7100dd4 commit 9abafb0

34 files changed

+1144
-530
lines changed

dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueConfig.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,13 @@ public class JobQueueConfig {
1010
*/
1111
private final int threadPoolSize;
1212

13-
// The interval in milliseconds to poll for job updates
14-
private final int pollJobUpdatesIntervalMilliseconds;
15-
1613
/**
1714
* Constructs a new JobQueueConfig
1815
*
1916
* @param threadPoolSize The number of threads to use for job processing.
20-
* @param pollJobUpdatesIntervalMilliseconds The interval in milliseconds to poll for job updates.
2117
*/
22-
public JobQueueConfig(int threadPoolSize, int pollJobUpdatesIntervalMilliseconds) {
18+
public JobQueueConfig(int threadPoolSize) {
2319
this.threadPoolSize = threadPoolSize;
24-
this.pollJobUpdatesIntervalMilliseconds = pollJobUpdatesIntervalMilliseconds;
2520
}
2621

2722
/**
@@ -33,13 +28,4 @@ public int getThreadPoolSize() {
3328
return threadPoolSize;
3429
}
3530

36-
/**
37-
* Gets the interval in milliseconds to poll for job updates.
38-
*
39-
* @return The interval in milliseconds to poll for job updates.
40-
*/
41-
public int getPollJobUpdatesIntervalMilliseconds() {
42-
return pollJobUpdatesIntervalMilliseconds;
43-
}
44-
4531
}

dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueConfigProducer.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public class JobQueueConfigProducer {
1616
"JOB_QUEUE_THREAD_POOL_SIZE", 10
1717
);
1818

19-
// The interval in milliseconds to poll for job updates.
20-
static final int DEFAULT_POLL_JOB_UPDATES_INTERVAL_MILLISECONDS = Config.getIntProperty(
21-
"JOB_QUEUE_POLL_JOB_UPDATES_INTERVAL_MILLISECONDS", 3000
22-
);
23-
2419
/**
2520
* Produces a JobQueueConfig object. This method is called by the CDI container to create a
2621
* JobQueueConfig instance when it is necessary for dependency injection.
@@ -30,8 +25,7 @@ public class JobQueueConfigProducer {
3025
@Produces
3126
public JobQueueConfig produceJobQueueConfig() {
3227
return new JobQueueConfig(
33-
DEFAULT_THREAD_POOL_SIZE,
34-
DEFAULT_POLL_JOB_UPDATES_INTERVAL_MILLISECONDS
28+
DEFAULT_THREAD_POOL_SIZE
3529
);
3630
}
3731

dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java

Lines changed: 60 additions & 103 deletions
Large diffs are not rendered by default.

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/EventProducer.java

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.dotcms.jobs.business.api.events;
2+
3+
import com.dotcms.jobs.business.job.Job;
4+
import java.time.LocalDateTime;
5+
6+
/**
7+
* Event fired when an abandoned job is detected.
8+
*/
9+
public class JobAbandonedEvent implements JobEvent {
10+
11+
private final Job job;
12+
private final LocalDateTime detectedAt;
13+
14+
/**
15+
* Constructs a new JobAbandonedEvent.
16+
*
17+
* @param job The job.
18+
* @param detectedAt The timestamp when the abandoned job was detected.
19+
*/
20+
public JobAbandonedEvent(Job job, LocalDateTime detectedAt) {
21+
this.job = job;
22+
this.detectedAt = detectedAt;
23+
}
24+
25+
/**
26+
* @return The abandoned job.
27+
*/
28+
public Job getJob() {
29+
return job;
30+
}
31+
32+
/**
33+
* @return The timestamp when the abandoned job was detected.
34+
*/
35+
public LocalDateTime getDetectedAt() {
36+
return detectedAt;
37+
}
38+
39+
}

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCancelRequestEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Event fired when there is a request to cancel a job.
88
*/
9-
public class JobCancelRequestEvent {
9+
public class JobCancelRequestEvent implements JobEvent {
1010

1111
private final Job job;
1212
private final LocalDateTime canceledOn;

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCanceledEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Event fired when a job is canceled.
88
*/
9-
public class JobCanceledEvent {
9+
public class JobCanceledEvent implements JobEvent {
1010

1111
private final Job job;
1212
private final LocalDateTime canceledAt;

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCancellingEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Event fired when a job is being canceled.
88
*/
9-
public class JobCancellingEvent {
9+
public class JobCancellingEvent implements JobEvent {
1010

1111
private final Job job;
1212
private final LocalDateTime canceledAt;

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCompletedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Event fired when a job completes successfully.
88
*/
9-
public class JobCompletedEvent {
9+
public class JobCompletedEvent implements JobEvent {
1010

1111
private final Job job;
1212
private final LocalDateTime completedAt;

dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCreatedEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* Event fired when a new job is created and added to the queue.
88
*/
9-
public class JobCreatedEvent {
9+
public class JobCreatedEvent implements JobEvent {
1010

1111
private final String jobId;
1212
private final String queueName;

0 commit comments

Comments
 (0)