Skip to content

Commit

Permalink
๐Ÿž BugFix/#121 - Spring Data Redis๋Š” ๊ธฐ๋ณธ ํ‚ค(@id) ๊ธฐ๋ฐ˜ ์‚ญ์ œ๋งŒ ์ง€์›ํ•ด์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ฒ„๊ทธ
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkyeomjang committed Nov 23, 2024
1 parent e8ccd5f commit 48eafff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ScheduledEventJobRepository extends CrudRepository<ScheduledEventJob, String> {
@NotNull List<ScheduledEventJob> findAll();

void deleteByEventId(Long eventId);
Optional<ScheduledEventJob> findByEventId(Long eventId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
Long eventId = context.getJobDetail().getJobDataMap().getLong("eventId");

// eventId๋ฅผ ํ†ตํ•ด ScheduledEventJob์„ ์‚ญ์ œ
scheduledEventJobRepository.deleteByEventId(eventId);
scheduledEventJobRepository.findByEventId(eventId)
.ifPresent(scheduledEventJobRepository::delete);
log.info("ScheduledEventJob ์‚ญ์ œ ์™„๋ฃŒ. eventId: {}", eventId);

processCompletedEventUseCase.execute(eventId);
Expand Down

0 comments on commit 48eafff

Please sign in to comment.