Skip to content

Commit

Permalink
adds configurable interval for alerter job (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndc-dxc authored Jul 12, 2024
1 parent 39a8003 commit bffb03d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static boolean isAlertable(Instant lastAlertedAt, Integer aggregationTim
return lastAlertedAt.plusSeconds(aggregationTime).isBefore(now);
}

@Scheduled(fixedDelayString = "${alerter.mail-sender.fixed-delay:10000}")
@Scheduled(fixedDelayString = "${alerter.mail-sender.fixed-delay-ms}")
void getEventsAndAlert() {

Collection<ProfileDto> profiles = profileService.findAll();
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spring.flyway.baseline-on-migrate=true
github.personal-access-token=${GITHUB_PERSONAL_ACCESS_TOKEN:}
server.error.include-message=always
alerter.mail.sender=${ALERTER_MAIL_SENDER:[email protected]}

# Default value of half an hour
alerter.mail-sender.fixed-delay-ms=${ALERTER_MAIL_SENDER_FIXED_DELAY:1800000}

spring.mail.host=${ALERTER_SMTP_SERVER:mail.smtpbucket.com}
spring.mail.port=${ALERTER_SMTP_PORT:8025}
spring.mail.username=${ALERTER_SMTP_USER:[email protected]}
Expand Down

0 comments on commit bffb03d

Please sign in to comment.