diff --git a/src/main/java/com/example/emergencyassistb4b4/domain/alert/redis/RedisThresholdCounter.java b/src/main/java/com/example/emergencyassistb4b4/domain/alert/redis/RedisThresholdCounter.java index 5514b4b..6f06ddd 100644 --- a/src/main/java/com/example/emergencyassistb4b4/domain/alert/redis/RedisThresholdCounter.java +++ b/src/main/java/com/example/emergencyassistb4b4/domain/alert/redis/RedisThresholdCounter.java @@ -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); } diff --git a/src/main/java/com/example/emergencyassistb4b4/domain/volunteer/dto/Post/UpdatePostRequest.java b/src/main/java/com/example/emergencyassistb4b4/domain/volunteer/dto/Post/UpdatePostRequest.java index 1ebc68a..b33ac3e 100644 --- a/src/main/java/com/example/emergencyassistb4b4/domain/volunteer/dto/Post/UpdatePostRequest.java +++ b/src/main/java/com/example/emergencyassistb4b4/domain/volunteer/dto/Post/UpdatePostRequest.java @@ -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; @@ -18,7 +17,6 @@ @NoArgsConstructor @AllArgsConstructor @Builder -@ValidAttendancePolicy public class UpdatePostRequest { @NotBlank(message = "제목은 필수입니다.")