mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 03:45:57 +00:00
[AB-184] adding various metrics to the system, organizing imports, changing some transactional behaviour
adding okhttp metrics, split bot service into multiple services (guild, message), unified some places that services are used in order to interact with the api, and not directly the objects (this is to make it easier for metric to be accurate)
This commit is contained in:
@@ -10,9 +10,9 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import static org.quartz.SimpleScheduleBuilder.*;
|
||||
import static org.quartz.CronScheduleBuilder.*;
|
||||
import static org.quartz.TriggerBuilder.*;
|
||||
import static org.quartz.CronScheduleBuilder.cronSchedule;
|
||||
import static org.quartz.SimpleScheduleBuilder.simpleSchedule;
|
||||
import static org.quartz.TriggerBuilder.newTrigger;
|
||||
|
||||
/**
|
||||
* Bean used to create the different types of jobs supported. The jobs include cron jobs and one-time jobs.
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Isolation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
||||
@@ -23,7 +24,7 @@ public class SchedulerStartupService {
|
||||
* Loads the job definitions from the database and schedules them, if the job does not exist yet.
|
||||
*/
|
||||
@EventListener
|
||||
@Transactional
|
||||
@Transactional(isolation = Isolation.SERIALIZABLE)
|
||||
public void handleContextRefreshEvent(ContextRefreshedEvent ctxStartEvt) {
|
||||
schedulerJobManagementServiceBean.findAll().forEach((schedulerJob) -> {
|
||||
if(!schedulerJobManagementServiceBean.doesJobExist(schedulerJob) || !schedulerJobManagementServiceBean.isJobDefinitionTheSame(schedulerJob)) {
|
||||
|
||||
Reference in New Issue
Block a user