🐛 修复 quartz 配置不生效.
This commit is contained in:
@@ -29,4 +29,6 @@ public interface Const extends com.orion.lang.constant.Const, FieldConst, CnCons
|
||||
|
||||
String SYSTEM_USERNAME = "system";
|
||||
|
||||
int BATCH_COUNT = 500;
|
||||
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ public class IpUtils {
|
||||
* @return addr
|
||||
*/
|
||||
public static String getRemoteAddr(HttpServletRequest request) {
|
||||
// 获取实际地址
|
||||
String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
|
||||
if (!Strings.isBlank(realIp)) {
|
||||
return realIp;
|
||||
}
|
||||
// 获取实际地址 X_REAL_IP 在多代理情况下会有问题
|
||||
// String realIp = request.getHeader(StandardHttpHeader.X_REAL_IP);
|
||||
// if (!Strings.isBlank(realIp)) {
|
||||
// return realIp;
|
||||
// }
|
||||
// 获取请求地址
|
||||
return Servlets.getRemoteAddr(request);
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import org.springframework.scheduling.quartz.SpringBeanJobFactory;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* quartz 配置
|
||||
@@ -22,27 +19,6 @@ import javax.sql.DataSource;
|
||||
@AutoConfigureOrder(AutoConfigureOrderConst.FRAMEWORK_JOB_QUARTZ)
|
||||
public class OrionQuartzAutoConfiguration {
|
||||
|
||||
/**
|
||||
* @return 任务工厂
|
||||
*/
|
||||
@Bean
|
||||
public SpringBeanJobFactory jobFactory() {
|
||||
return new SpringBeanJobFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dataSource dataSource
|
||||
* @param jobFactory jobFactory
|
||||
* @return 调度器工厂
|
||||
*/
|
||||
@Bean
|
||||
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource, SpringBeanJobFactory jobFactory) {
|
||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
factory.setDataSource(dataSource);
|
||||
factory.setJobFactory(jobFactory);
|
||||
return factory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param schedulerFactoryBean 调度器工厂
|
||||
* @return 调度器
|
||||
|
||||
@@ -6,6 +6,9 @@ import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 不执行统一日志打印
|
||||
* <p>
|
||||
* 如果设置在方法上,则忽略该方法的日志打印
|
||||
* 如果设置到参数上,则忽略该参数的日志打印
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.orion.visor.framework.mybatis.core.mapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.Db;
|
||||
import com.orion.visor.framework.common.constant.Const;
|
||||
import com.orion.visor.framework.mybatis.core.query.Conditions;
|
||||
import com.orion.visor.framework.mybatis.core.query.DataQuery;
|
||||
|
||||
@@ -61,7 +62,7 @@ public interface IMapper<T> extends BaseMapper<T> {
|
||||
* @return 是否成功
|
||||
*/
|
||||
default boolean insertBatch(Collection<T> entities) {
|
||||
return Db.saveBatch(entities);
|
||||
return this.insertBatch(entities, Const.BATCH_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,7 +83,7 @@ public interface IMapper<T> extends BaseMapper<T> {
|
||||
* @return 是否成功
|
||||
*/
|
||||
default boolean updateBatch(Collection<T> entities) {
|
||||
return Db.updateBatchById(entities);
|
||||
return this.updateBatch(entities, Const.BATCH_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +114,7 @@ public interface IMapper<T> extends BaseMapper<T> {
|
||||
* @return 是否成功
|
||||
*/
|
||||
default boolean insertOrUpdateBatch(Collection<T> entities) {
|
||||
return Db.saveOrUpdateBatch(entities);
|
||||
return this.insertOrUpdateBatch(entities, Const.BATCH_COUNT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<card-list v-model:searchValue="formModel.searchValue"
|
||||
search-input-placeholder="输入搜索值"
|
||||
create-card-position="head"
|
||||
:create-card-position="false"
|
||||
:loading="loading"
|
||||
:field-config="fieldConfig"
|
||||
:list="list"
|
||||
|
||||
@@ -82,13 +82,13 @@ spring:
|
||||
instanceName: quartzScheduler
|
||||
jobStore:
|
||||
# 持久化配置
|
||||
class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
|
||||
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
|
||||
useProperties: false
|
||||
tablePrefix: QRTZ_
|
||||
misfireThreshold: 60000
|
||||
clusterCheckinInterval: 5000
|
||||
isClustered: true
|
||||
isClustered: false
|
||||
# 连接池
|
||||
threadPool:
|
||||
class: org.quartz.simpl.SimpleThreadPool
|
||||
|
||||
@@ -98,7 +98,7 @@ public class HostController {
|
||||
@IgnoreLog(IgnoreLogMode.RET)
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询主机")
|
||||
@Parameter(name = "type", description = "type", required = false)
|
||||
@Parameter(name = "type", description = "type")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host:query')")
|
||||
public List<HostVO> getHostList(@RequestParam(value = "type", required = false) String type) {
|
||||
return hostService.getHostList(type);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<card-list v-model:searchValue="formModel.searchValue"
|
||||
search-input-placeholder="输入 id / 名称 / 用户名"
|
||||
:create-card-position="false"
|
||||
:loading="loading"
|
||||
:field-config="fieldConfig"
|
||||
:list="list"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<card-list v-model:searchValue="formModel.searchValue"
|
||||
search-input-placeholder="输入 id / 名称"
|
||||
:create-card-position="false"
|
||||
:loading="loading"
|
||||
:field-config="fieldConfig"
|
||||
:list="list"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<card-list v-model:searchValue="formModel.searchValue"
|
||||
search-input-placeholder="输入 id / 名称 / 编码 / 地址"
|
||||
:create-card-position="false"
|
||||
:loading="loading"
|
||||
:field-config="fieldConfig"
|
||||
:list="list"
|
||||
|
||||
@@ -143,8 +143,8 @@
|
||||
try {
|
||||
// 查询
|
||||
const data = await cacheStore.loadCommandSnippets(true);
|
||||
snippetGroups.value = data.groups;
|
||||
ungroupedItems.value = data.ungroupedItems;
|
||||
snippetGroups.value = data.groups || [];
|
||||
ungroupedItems.value = data.ungroupedItems || [];
|
||||
// 设置状态
|
||||
filterSnippet();
|
||||
} catch (e) {
|
||||
|
||||
@@ -145,8 +145,8 @@
|
||||
try {
|
||||
// 查询
|
||||
const data = await cacheStore.loadPathBookmarks(true);
|
||||
bookmarkGroups.value = data.groups;
|
||||
ungroupedItems.value = data.ungroupedItems;
|
||||
bookmarkGroups.value = data.groups || [];
|
||||
ungroupedItems.value = data.ungroupedItems || [];
|
||||
// 设置状态
|
||||
filterPath();
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user