File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Ticket-Api/src/main/java/com/jnu/ticketapi/api/event/service Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 13
13
import com .jnu .ticketinfrastructure .redis .RedisRepository ;
14
14
import lombok .RequiredArgsConstructor ;
15
15
import org .springframework .beans .factory .annotation .Autowired ;
16
+ import org .springframework .beans .factory .annotation .Value ;
16
17
import org .springframework .transaction .annotation .Transactional ;
17
18
18
19
@ UseCase
@@ -26,13 +27,18 @@ public class EventDeleteUseCase {
26
27
private final SectorAdaptor sectorAdaptor ;
27
28
private final RegistrationAdaptor registrationAdaptor ;
28
29
30
+ @ Value ("${ableRedis:true}" )
31
+ private boolean ableRedis ;
32
+
29
33
@ Transactional
30
34
public void deleteEvent (Long eventId ) {
31
35
Event event = eventAdaptor .findById (eventId );
32
36
Events .raise (EventDeletedEvent .of (event ));
33
37
event .deleteEvent ();
34
38
event .updateStatus (EventStatus .CLOSED , null );
35
- redisRepository .delete (REDIS_EVENT_ISSUE_STORE );
39
+ if (ableRedis ) {
40
+ redisRepository .delete (REDIS_EVENT_ISSUE_STORE );
41
+ }
36
42
sectorAdaptor .deleteByEvent (eventId );
37
43
registrationAdaptor .deleteByEvent (eventId );
38
44
}
You can’t perform that action at this time.
0 commit comments