Skip to content

Commit

Permalink
fix a msgId error
Browse files Browse the repository at this point in the history
  • Loading branch information
yuz10 committed Oct 2, 2021
1 parent 4838592 commit 1c20e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resty/rocketmq/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ do
local pidBin = char(rshift(pid, 8)) .. char(band(pid, 0xff))
local clientIdHash = char(random(0, 255)) .. char(random(0, 255)) .. char(random(0, 255)) .. char(random(0, 255))
local counter = 0
local tt = os.date("*t")
local tt = os.date("!*t")
local thisMonth = timestamp(tt.year, tt.month, 0, 0, 0, 0)
local nextMonth = timestamp(tt.year, tt.month + 1, 0, 0, 0, 0)

_M.genUniqId = function()
local time = ngx.now()
if time >= nextMonth then
local tt = os.date("*t", time)
local tt = os.date("!*t", time)
thisMonth = timestamp(tt.year, tt.month, 0, 0, 0, 0)
nextMonth = timestamp(tt.year, tt.month + 1, 0, 0, 0, 0)
end
Expand Down

0 comments on commit 1c20e03

Please sign in to comment.