Skip to content
Merged
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 @@ -11,9 +11,8 @@ public class NotificationScheduler {

private final NotificationServiceImpl notificationServiceImpl;
// 주기적으둜 μ‹€ν–‰ν•  μž‘μ—…μ„ μ •μ˜ν•  λ•Œ μ‚¬μš©
// @Scheduled(cron = "0 0 0 * * *") // λ§€ μ‹œκ°„ μ •κ°λ§ˆλ‹€
@Scheduled(cron = "0 0 0 * * *") // λ§€ μ‹œκ°„ μ •κ°λ§ˆλ‹€

@Scheduled(cron = "0 */1 * * * *") // λ§€ 1λΆ„λ§ˆλ‹€ μ‹€ν–‰
public void runNotificationJob() {
notificationServiceImpl.checkAndLogPriceAlerts();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ countyCode, getToday(), getToday()
int price = Integer.parseInt(priceText);

boolean shouldNotify =
(n.getType() == Type.WHOLESALE && price > n.getTargetPrice()) ||
(n.getType() == Type.RETAIL && price < n.getTargetPrice());
(n.getType() == Type.WHOLESALE && price >= n.getTargetPrice()) ||
(n.getType() == Type.RETAIL && price <= n.getTargetPrice());

if (shouldNotify) {
String direction = (n.getType() == Type.WHOLESALE) ? "μƒμŠΉ" : "ν•˜λ½";
NotificationLog logEntity = NotificationLog.builder()
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spring:
generate_ddl: true
use_sql_comments: true
hbm2ddl:
auto: update
auto: create
default_batch_fetch_size: 1000
database: mysql

Expand Down
Loading