implemented scheduled worker that processes queued notifications
This commit is contained in:
@@ -42,11 +42,19 @@ public class Notification {
|
||||
|
||||
@Column(nullable = false)
|
||||
@Enumerated(EnumType.STRING)
|
||||
private NotificationStatus status;
|
||||
private NotificationStatus status = NotificationStatus.PENDING;
|
||||
|
||||
/**
|
||||
* Number of retry attempts made to send this notification.
|
||||
*/
|
||||
@Column(nullable = false)
|
||||
private int retryCount;
|
||||
private int failedSendAttempts = 0;
|
||||
|
||||
@Column(nullable = false)
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
public void incrementFailedSendAttempts() {
|
||||
this.failedSendAttempts++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user