Skip to content

Commit

Permalink
Merge pull request #602 from xstefank/singleton-reporter
Browse files Browse the repository at this point in the history
Move SmallRyeHealthReporter init into the post construct method
  • Loading branch information
xstefank authored Jan 8, 2025
2 parents 0a5ebf4 + 7569257 commit 998db2d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public class SmallRyeHealthReporter {
private List<Uni<HealthCheckResponse>> wellnessUnis = new CopyOnWriteArrayList<>();
private List<Uni<HealthCheckResponse>> startupUnis = new CopyOnWriteArrayList<>();

public SmallRyeHealthReporter() {
@PostConstruct
public void postConstruct() {
try {
Config config = ConfigProvider.getConfig();
contextPropagated = config
Expand Down Expand Up @@ -176,10 +177,7 @@ public SmallRyeHealthReporter() {
if (asyncHealthCheckFactory == null) {
asyncHealthCheckFactory = new AsyncHealthCheckFactory();
}
}

@PostConstruct
public void postConstruct() {
if (!delayHealthCheckInit) {
initChecks();
}
Expand Down
10 changes: 6 additions & 4 deletions implementation/src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
version="4.0"
bean-discovery-mode="annotated">
</beans>
</beans>
8 changes: 5 additions & 3 deletions testsuite/tck/src/test/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd"
version="4.0"
bean-discovery-mode="all">
</beans>

0 comments on commit 998db2d

Please sign in to comment.