Skip to content

Commit

Permalink
add message to Pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
nomad4tech committed Dec 16, 2024
1 parent 00d95b8 commit 586b87c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/main/java/tech/nomad4/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class AppConfig {

private Boolean reportPulse;

private String message;

@PostConstruct
public void validateConfig() {
handleAnnotation();
Expand Down Expand Up @@ -104,6 +106,8 @@ private void handleAnnotation() {
maxPulseDelaySec = annotation.maxPulseDelaySec();
if (reportPulse == null)
reportPulse = annotation.reportMe();
if (message == null)
message = annotation.message();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tech/nomad4/EnablePulseService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
int maxPulseDelaySec() default 1;
int alertDelaySec() default 60;
boolean reportMe() default false;
String message() default "";

}
2 changes: 1 addition & 1 deletion src/main/java/tech/nomad4/service/PulseService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PulseService {

public void pulse() {
Pulse pulse = new Pulse();
pulse.setMessage("");
pulse.setMessage(appConfig.getMessage());
pulse.setName(appConfig.getName());
pulse.setAlertTries(appConfig.getAlertTries());
pulse.setMaxPulseDelaySec(appConfig.getMaxPulseDelaySec());
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ pulse4app.name=
pulse4app.alert-tries=
pulse4app.alert-delay-sec=
pulse4app.report-pulse=
pulse4app.max-pulse-delay-sec=


pulse4app.max-pulse-delay-sec=

0 comments on commit 586b87c

Please sign in to comment.