Skip to content

Commit badd48d

Browse files
committed
update
1 parent d5a8f4a commit badd48d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

08cache/cache/src/main/java/io/kimmking/cache/service/UserServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public class UserServiceImpl implements UserService {
1515
UserMapper userMapper;
1616

1717
// 开启spring cache
18-
@Cacheable //(key="#id",value="userCache")
18+
@Cacheable(key="#id",value="userCache")
1919
public User find(int id) {
20-
//System.out.println(" ==> find " + id);
20+
System.out.println(" ==> find " + id);
2121
return userMapper.find(id);
2222
}
2323

08cache/cache/src/main/resources/application.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ spring:
77
password:
88
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
99
driver-class-name: com.mysql.jdbc.Driver
10-
# cache:
11-
# type: redis
10+
cache:
11+
type: redis
1212
redis:
1313
host: localhost
1414
lettuce:
1515
pool:
16-
max-active: 32
16+
max-active: 16
1717
max-wait: 10ms
1818

1919
# type: ehcache

0 commit comments

Comments
 (0)