Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ public class RedisThresholdCounter {
static {
LUA_SCRIPT = new DefaultRedisScript<>();
LUA_SCRIPT.setScriptText(
"""
local count = redis.call('INCR', KEYS[1])
redis.call('EXPIRE', KEYS[1], toNumber(ARGV[1]))

for i = 2, #ARGV do
local threshold = toNumber(ARGV[i])
if count == threshold then
local notifyKey = KEYS[2] .. ":" .. threshold
local set = redis.call('SETNX', notifyKey, "true")
if set == 1 then
redis.call('EXPIRE', notifyKey, toNumber(ARGV[1]))
return threshold
else
return -1
"""
local count = redis.call('INCR', KEYS[1])
redis.call('EXPIRE', KEYS[1], tonumber(ARGV[1]))

for i = 2, #ARGV do
local threshold = tonumber(ARGV[i])
if count == threshold then
local notifyKey = KEYS[2] .. ":" .. threshold
local set = redis.call('SETNX', notifyKey, "true")
if set == 1 then
redis.call('EXPIRE', notifyKey, tonumber(ARGV[1]))
return threshold
else
return -1
end
end
end
end

return -1
"""

return -1
"""
);
LUA_SCRIPT.setResultType(Long.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.example.emergencyassistb4b4.domain.volunteer.dto.Post.common.PostAttendancePolicyDto;
import com.example.emergencyassistb4b4.domain.volunteer.dto.Post.common.PostLocationDto;
import com.example.emergencyassistb4b4.domain.volunteer.dto.validator.ValidAttendancePolicy;
import com.example.emergencyassistb4b4.domain.volunteer.enums.PostStatus;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
Expand All @@ -18,7 +17,6 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ValidAttendancePolicy
public class UpdatePostRequest {

@NotBlank(message = "제λͺ©μ€ ν•„μˆ˜μž…λ‹ˆλ‹€.")
Expand Down