格式化
This commit is contained in:
parent
2f034547e4
commit
f7487353be
|
@ -1,10 +1,10 @@
|
||||||
package net.maku.quartz.config;
|
package net.maku.quartz.config;
|
||||||
|
|
||||||
|
import net.maku.framework.common.constant.Constant;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import net.maku.framework.common.constant.Constant;
|
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
@ -17,7 +17,6 @@ import java.util.Properties;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ScheduleConfig {
|
public class ScheduleConfig {
|
||||||
|
|
||||||
@Value("spring.datasource.driver-class-name")
|
@Value("spring.datasource.driver-class-name")
|
||||||
private String driver;
|
private String driver;
|
||||||
|
|
||||||
|
@ -43,10 +42,11 @@ public class ScheduleConfig {
|
||||||
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
||||||
prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
||||||
|
|
||||||
//postgreSql数据库配置
|
// PostgreSQL数据库配置
|
||||||
if (Constant.PGSQL_DRIVER.equals(driver)) {
|
if (Constant.PGSQL_DRIVER.equals(driver)) {
|
||||||
prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
|
prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
|
||||||
}
|
}
|
||||||
|
|
||||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||||
factory.setSchedulerName("MakuScheduler");
|
factory.setSchedulerName("MakuScheduler");
|
||||||
factory.setDataSource(dataSource);
|
factory.setDataSource(dataSource);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user