|
|
@@ -20,35 +20,35 @@ public class ScheduleConfig {
|
|
20
|
20
|
@Bean
|
|
21
|
21
|
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) {
|
|
22
|
22
|
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
|
23
|
|
- factory.setDataSource(dataSource);
|
|
24
|
|
-
|
|
25
|
|
- //quartz参数
|
|
26
|
|
- Properties prop = new Properties();
|
|
27
|
|
- prop.put("org.quartz.scheduler.instanceName", "RenrenScheduler");
|
|
28
|
|
- prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
|
29
|
|
- //线程池配置
|
|
30
|
|
- prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
|
31
|
|
- prop.put("org.quartz.threadPool.threadCount", "20");
|
|
32
|
|
- prop.put("org.quartz.threadPool.threadPriority", "5");
|
|
33
|
|
- //JobStore配置
|
|
34
|
|
- prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
|
35
|
|
- //集群配置
|
|
36
|
|
- prop.put("org.quartz.jobStore.isClustered", "true");
|
|
37
|
|
- prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
|
38
|
|
- prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
|
39
|
|
-
|
|
40
|
|
- prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
|
41
|
|
- prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
|
42
|
|
- factory.setQuartzProperties(prop);
|
|
43
|
|
-
|
|
44
|
|
- factory.setSchedulerName("RenrenScheduler");
|
|
45
|
|
- //延时启动
|
|
46
|
|
- factory.setStartupDelay(30);
|
|
47
|
|
- factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
|
48
|
|
- //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
|
49
|
|
- factory.setOverwriteExistingJobs(true);
|
|
50
|
|
- //设置自动启动,默认为true
|
|
51
|
|
- factory.setAutoStartup(true);
|
|
|
23
|
+// factory.setDataSource(dataSource);
|
|
|
24
|
+//
|
|
|
25
|
+// //quartz参数
|
|
|
26
|
+// Properties prop = new Properties();
|
|
|
27
|
+// prop.put("org.quartz.scheduler.instanceName", "RenrenScheduler");
|
|
|
28
|
+// prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
|
|
29
|
+// //线程池配置
|
|
|
30
|
+// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
|
|
31
|
+// prop.put("org.quartz.threadPool.threadCount", "20");
|
|
|
32
|
+// prop.put("org.quartz.threadPool.threadPriority", "5");
|
|
|
33
|
+// //JobStore配置
|
|
|
34
|
+// prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
|
|
35
|
+// //集群配置
|
|
|
36
|
+// prop.put("org.quartz.jobStore.isClustered", "true");
|
|
|
37
|
+// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
|
|
38
|
+// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
|
|
39
|
+//
|
|
|
40
|
+// prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
|
|
41
|
+// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
|
|
42
|
+// factory.setQuartzProperties(prop);
|
|
|
43
|
+//
|
|
|
44
|
+// factory.setSchedulerName("RenrenScheduler");
|
|
|
45
|
+// //延时启动
|
|
|
46
|
+// factory.setStartupDelay(30);
|
|
|
47
|
+// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
|
|
48
|
+// //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
|
|
49
|
+// factory.setOverwriteExistingJobs(true);
|
|
|
50
|
+// //设置自动启动,默认为true
|
|
|
51
|
+// //factory.setAutoStartup(true);
|
|
52
|
52
|
|
|
53
|
53
|
return factory;
|
|
54
|
54
|
}
|