mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 10:13:28 +08:00
update 简化代码
This commit is contained in:
parent
b4f3973e38
commit
bfb05c977d
@ -33,13 +33,13 @@ public class RedisLockController {
|
|||||||
@Lock4j(keys = {"#key"})
|
@Lock4j(keys = {"#key"})
|
||||||
@GetMapping("/testLock4j")
|
@GetMapping("/testLock4j")
|
||||||
public R<String> testLock4j(String key, String value) {
|
public R<String> testLock4j(String key, String value) {
|
||||||
System.out.println("start:" + key + ",time:" + LocalTime.now().toString());
|
System.out.println("start:" + key + ",time:" + LocalTime.now());
|
||||||
try {
|
try {
|
||||||
Thread.sleep(10000);
|
Thread.sleep(10000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
System.out.println("end :" + key + ",time:" + LocalTime.now().toString());
|
System.out.println("end :" + key + ",time:" + LocalTime.now());
|
||||||
return R.ok("操作成功", value);
|
return R.ok("操作成功", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class BoundedQueueController {
|
|||||||
for (int i = 0; i < 11; i++) {
|
for (int i = 0; i < 11; i++) {
|
||||||
String data = "data-" + i;
|
String data = "data-" + i;
|
||||||
boolean flag = QueueUtils.addBoundedQueueObject(queueName, data);
|
boolean flag = QueueUtils.addBoundedQueueObject(queueName, data);
|
||||||
if (flag == false) {
|
if (!flag) {
|
||||||
log.info("通道: {} , 发送数据: {} 失败, 通道已满", queueName, data);
|
log.info("通道: {} , 发送数据: {} 失败, 通道已满", queueName, data);
|
||||||
} else {
|
} else {
|
||||||
log.info("通道: {} , 发送数据: {}", queueName, data);
|
log.info("通道: {} , 发送数据: {}", queueName, data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user