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

[CPL-283] Add Disable Jobs Property #213

Merged
merged 11 commits into from
Nov 27, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public boolean hasFinished(ExecuteAsyncHandle handle) {
public void reset() {
transactionsHelper.withTransaction().asNew().call(() -> {
testTasksService.reset();
initJobs(true);
if (jobsProperties.isAutoStartProcessing()) {
initJobs(true);
}
return null;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ public class JobsProperties {
private String processingBucket = IBucketsManager.DEFAULT_ID;

private boolean testMode = false;

private boolean autoStartProcessing = true;
yijun-lin marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class JobsService implements IJobsService, GracefulShutdownStrategy, Init
@Autowired
private ITasksService tasksService;
@Autowired
private JobsProperties jobsProperties;
protected JobsProperties jobsProperties;
@Autowired
private ApplicationContext applicationContext;
@Autowired(required = false)
Expand All @@ -60,7 +60,9 @@ public void afterPropertiesSet() {

@Override
public void applicationStarted() {
initJobs(false);
if (jobsProperties.isAutoStartProcessing()) {
initJobs(false);
}
}

@Override
Expand Down
Loading