Skip to content

Commit

Permalink
Fixed issue that would cause jobs not to be enabled after restart (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Edwards-cgi authored Jun 19, 2024
1 parent 85f5605 commit c2b1278
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.quartz.TriggerKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import uk.gov.hmcts.juror.scheduler.datastore.entity.api.APIJobDetailsEntity;
import uk.gov.hmcts.juror.scheduler.datastore.model.JobType;
import uk.gov.hmcts.juror.scheduler.service.contracts.SchedulerService;
Expand Down Expand Up @@ -56,6 +57,7 @@ public void preDestroy() {
}

@Override
@Transactional
public void register(APIJobDetailsEntity jobDetails) {
if (jobDetails.getCronExpression() != null) {
scheduleCronJob(jobDetails);
Expand Down Expand Up @@ -130,6 +132,7 @@ public boolean isDisabled(String jobKey) {
}

@Override
@Transactional
public void unregister(String jobKey) {
try {
scheduler.deleteJob(createJobKey(jobKey));
Expand Down

0 comments on commit c2b1278

Please sign in to comment.