1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-20 22:17:09 +08:00

Merge pull request #1864 from liubobo1996/main

[docs fix]修正 expire 命令的使用
This commit is contained in:
Guide 2022-11-04 09:58:37 +08:00 committed by GitHub
commit 609a990315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,7 +322,7 @@ io-threads 4 #官网建议4核的机器建议设置为2或3个线程8核的
Redis 自带了给缓存数据设置过期时间的功能,比如: Redis 自带了给缓存数据设置过期时间的功能,比如:
```bash ```bash
127.0.0.1:6379> exp key 60 # 数据在 60s 后过期 127.0.0.1:6379> expire key 60 # 数据在 60s 后过期
(integer) 1 (integer) 1
127.0.0.1:6379> setex key 60 value # 数据在 60s 后过期 (setex:[set] + [ex]pire) 127.0.0.1:6379> setex key 60 value # 数据在 60s 后过期 (setex:[set] + [ex]pire)
OK OK