Skip to content

Commit

Permalink
chore: Ticketing script 주석 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
xxeol2 committed Sep 7, 2023
1 parent cc3877c commit c292002
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/src/main/resources/scripts/ticketing.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
local memberTryCount = redis.call("INCR", KEYS[1])
redis.call("EXPIRE", KEYS[1], 1)

-- 따닥인 경우
if memberTryCount > tonumber(ARGV[1])
then
return -2
end

local remainAmount = redis.call("DECR", KEYS[2])

-- 품절인 경우
if remainAmount < 0
then
return -1
end

return remainAmount

0 comments on commit c292002

Please sign in to comment.