Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 종목 지정가 도달 알림 문제 해결 #268

Closed
yonghwankim-dev opened this issue Mar 12, 2024 · 0 comments · Fixed by #269
Closed

[bug] 종목 지정가 도달 알림 문제 해결 #268

yonghwankim-dev opened this issue Mar 12, 2024 · 0 comments · Fixed by #269
Assignees
Labels
bug Something isn't working

Comments

@yonghwankim-dev
Copy link
Member

yonghwankim-dev commented Mar 12, 2024

상황

종목 지정가 도달 알림 간격을 24H으로 설정했음에도 불구하고 지정가에 도달할때마다 알림을 보냅니다.
image

원인

종목 지정가 알림 전송 이력을 저장할때 TargetPriceNotification 엔티티의 PK 등록번호(id)를 저장해야 했으나, 사용자에게 전달한 푸시 알림의 등록번호(Notification.id)를 저장하여서 알림을 계속 보냈습니다.

// 발송 이력 저장
.map(future -> future.thenCompose(item -> {
	// todo: targetPriceNotificationId를 저장해야 한다.
	sentManager.addTargetPriceNotification(item.getNotificationId());
	return CompletableFuture.supplyAsync(() -> item);
}))

해결방법

종목 지정가 알림 전송 이력 저장시 TargetPriceNotification.id를 저장합니다.

// 발송 이력 저장
.map(future -> future.thenCompose(item -> {
	sentManager.addTargetPriceNotification(item.getTargetPriceNotificationId());
	return CompletableFuture.supplyAsync(() -> item);
}))
@yonghwankim-dev yonghwankim-dev added the bug Something isn't working label Mar 12, 2024
@yonghwankim-dev yonghwankim-dev added this to the [BE] Sprint #21 milestone Mar 12, 2024
@yonghwankim-dev yonghwankim-dev self-assigned this Mar 12, 2024
@yonghwankim-dev yonghwankim-dev linked a pull request Mar 12, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this to Done in BE Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant