mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-26 05:44:42 +00:00
[AB-285] fixing interval of warn decay job
removing has example config from unban enabling to change the configuration for cron scheduler job adding HTTP method to okhttp logger fixing unmute job parameters changing to use cache when retrieving reactions for a message to cache it
This commit is contained in:
@@ -68,7 +68,18 @@ public class SchedulerServiceBean implements SchedulerService {
|
||||
scheduler.addJob(jobDetail, true);
|
||||
}
|
||||
} else {
|
||||
log.info("Not scheduling job {}, because it was already scheduled.", schedulerJob.getName());
|
||||
if(isRecurringJob(schedulerJob)) {
|
||||
jobDetail = scheduleCreator.createJob((Class<? extends QuartzJobBean>) Class.forName(schedulerJob.getClazz()),
|
||||
true, context, schedulerJob.getName(), schedulerJob.getGroupName(), schedulerJob.isRecovery());
|
||||
List<? extends Trigger> triggers = scheduler.getTriggersOfJob(jobDetail.getKey());
|
||||
|
||||
Trigger trigger = scheduleCreator.createBasicCronTrigger(new Date(),
|
||||
schedulerJob.getCronExpression());
|
||||
scheduler.rescheduleJob(triggers.get(0).getKey(), trigger);
|
||||
log.info("Rescheduling job {}, its a cron job and the definition might have changed.", schedulerJob.getName());
|
||||
} else {
|
||||
log.info("Not scheduling job {}, because it was already scheduled.", schedulerJob.getName());
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException | SchedulerException e) {
|
||||
log.error("Failed to schedule job", e);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class SchedulerStartupService {
|
||||
@Transactional(isolation = Isolation.SERIALIZABLE)
|
||||
public void handleContextRefreshEvent(ContextRefreshedEvent ctxStartEvt) {
|
||||
schedulerJobManagementServiceBean.findAll().forEach(schedulerJob -> {
|
||||
if(!schedulerJobManagementServiceBean.doesJobExist(schedulerJob) || !schedulerJobManagementServiceBean.isJobDefinitionTheSame(schedulerJob)) {
|
||||
if(!schedulerJobManagementServiceBean.doesJobExist(schedulerJob)) {
|
||||
schedulerJobManagementServiceBean.createOrUpdate(schedulerJob);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user