Skip to content

Commit

Permalink
feat(*): redis message key
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonZhiZhi authored and JasonZhiZhi committed Oct 23, 2024
1 parent bf5a9ee commit 89ace04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from ac720c to 2b9cdf
6 changes: 4 additions & 2 deletions pkg/gen_id/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ const (
// msg_id
const (
// 计算:相对时间戳
baseTimeStampOffset = 1677004307 // 2023-02-22 02:31:47
expireMsgKey = 2 * time.Second // 生成 msg_id 时,redis key的有效期(2秒)
baseTimeStampOffset = 1677004307 // 2023-02-22 02:31:47
// 生成 msg_id 时,redis key的有效期(5秒)
// 需要考虑:时间回退的问题、过期key淘汰
expireMsgKey = 5 * time.Second
)

// version_id
Expand Down

0 comments on commit 89ace04

Please sign in to comment.