Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
O
operate-customer-service
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
沈振路
operate-customer-service
Commits
322b22c7
提交
322b22c7
authored
10月 20, 2022
作者:
沈振路
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
延时客服-finish
上级
8fea31c8
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
3 行增加
和
37 行删除
+3
-37
CustomerServiceApplication.java
...ava/com/yaoyaozw/customer/CustomerServiceApplication.java
+1
-1
SchedulingTask.java
...java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
+1
-1
bootstrap.yml
src/main/resources/bootstrap.yml
+1
-1
Test.java
src/test/java/Test.java
+0
-34
没有找到文件。
src/main/java/com/yaoyaozw/customer/CustomerServiceApplication.java
浏览文件 @
322b22c7
...
...
@@ -12,7 +12,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* @date 2022/9/15 18:13
*/
@SpringBootApplication
//
@EnableScheduling
@EnableScheduling
@MapperScan
(
"com.yaoyaozw.customer.mapper"
)
@EnableFeignClients
@EnableAsync
...
...
src/main/java/com/yaoyaozw/customer/scheduling/SchedulingTask.java
浏览文件 @
322b22c7
...
...
@@ -124,7 +124,7 @@ public class SchedulingTask {
/**
* 从redis中更新人群包人数
*/
@Scheduled
(
cron
=
"0 0/15 * * * ?"
)
//
@Scheduled(cron = "0 0/15 * * * ?")
public
void
updateCrowdPackageNumFromRedis
()
{
localLog
.
info
(
"开始同步redis中人群包人数至数据库"
);
HashMap
<
String
,
Integer
>
entries
=
(
HashMap
<
String
,
Integer
>)
redisTemplate
.
boundHashOps
(
CustomerCommonConstant
.
CROWD_HUMAN_NUN_REDIS_KEY
).
entries
();
...
...
src/main/resources/bootstrap.yml
浏览文件 @
322b22c7
...
...
@@ -4,7 +4,7 @@ spring:
application
:
name
:
customer-service
profiles
:
active
:
dev
active
:
pro
---
spring
:
profiles
:
dev
...
...
src/test/java/Test.java
deleted
100644 → 0
浏览文件 @
8fea31c8
import
com.yaoyaozw.customer.CustomerServiceApplication
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.concurrent.TimeUnit
;
/**
* @author darker
* @date 2022/10/19 14:42
*/
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
CustomerServiceApplication
.
class
)
public
class
Test
{
@Autowired
private
RedisTemplate
redisTemplate
;
@org
.
junit
.
Test
public
void
testRedis
()
{
redisTemplate
.
opsForValue
().
set
(
"count"
,
0
);
redisTemplate
.
expire
(
"count"
,
1
,
TimeUnit
.
MINUTES
);
try
{
Thread
.
sleep
(
15000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
redisTemplate
.
opsForValue
().
increment
(
"count"
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论