Commit 0e27fb58 by guo_minglei@163.com

admin添加运行信息

parent 13143559
......@@ -53,6 +53,10 @@
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
</dependencies>
<build>
......
package com.byit.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
public class RedisConfig {
@Bean
StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory){
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(connectionFactory);
stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer());
return stringRedisTemplate;
}
}
......@@ -2,12 +2,14 @@ package com.byit.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.byit.dto.plugin.RunLog;
import com.byit.dto.plugin.RunNode;
import com.byit.enums.NodePropertyEnum;
import com.byit.mapper.JobTaskScheduleMapper;
import com.byit.model.JobTaskSchedule;
import com.byit.service.ApiNodeService;
import com.byit.utils.ValidationUtil;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -23,6 +25,9 @@ public class ApiNodeServiceImpl implements ApiNodeService {
@Resource
private JobTaskScheduleMapper jobTaskScheduleMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Override
public String runNode(String param) {
......@@ -50,6 +55,9 @@ public class ApiNodeServiceImpl implements ApiNodeService {
jobTaskScheduleMapper.saveJobTaskSchedule(schedule);
RunLog runLog = RunLog.builder().isEnd(false).runLog("等待服务器分配资源").build();
stringRedisTemplate.convertAndSend(runId, JSON.toJSONString(runLog));
return runId;
}
}
......@@ -14,6 +14,18 @@ spring:
properties:
from: huangfusuper@163.com
redis:
database: 0
host: 10.0.120.218
port: 6379
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis:
mapper-locations: /mapper/*.xml
......@@ -38,4 +50,6 @@ file:
port: 88
myth-job:
filestystem: FASTDFS
\ No newline at end of file
filestystem: FASTDFS
......@@ -14,6 +14,18 @@ spring:
properties:
from: huangfusuper@163.com
redis:
database: 0
host: 10.0.120.218
port: 6379
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis:
mapper-locations: /mapper/*.xml
......
......@@ -14,6 +14,18 @@ spring:
properties:
from: huangfusuper@163.com
redis:
database: 0
host: ${Redis_IP}
port: ${Redis_port}
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis:
mapper-locations: /mapper/*.xml
......
......@@ -14,6 +14,18 @@ spring:
properties:
from: huangfusuper@163.com
redis:
database: 0
host: ${Redis_IP}
port: ${Redis_port}
password:
pool:
max-active: 8
max-wait: 30
max-idle: 8
min-idle: 0
timeout: 60000
mybatis:
mapper-locations: /mapper/*.xml
......
......@@ -11,9 +11,9 @@ public class RedisConfig {
@Bean
StringRedisTemplate stringRedisTemplate(RedisConnectionFactory connectionFactory){
// StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
// stringRedisTemplate.setConnectionFactory(connectionFactory);
// stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer());
return new StringRedisTemplate(connectionFactory);
StringRedisTemplate stringRedisTemplate = new StringRedisTemplate();
stringRedisTemplate.setConnectionFactory(connectionFactory);
stringRedisTemplate.setDefaultSerializer(new StringRedisSerializer());
return stringRedisTemplate;
}
}
......@@ -20,7 +20,7 @@ myth-job:
spring:
redis:
database: 0
host: 10.0.101.133
host: 10.0.120.218
port: 6379
password:
pool:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment