Skip to content

Commit

Permalink
Made initialization of ruleApiSpecs thread-safe inside ApiDocsInterce…
Browse files Browse the repository at this point in the history
…ptor
  • Loading branch information
t-burch committed Jul 12, 2024
1 parent a3995fa commit f882c45
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ public class ApiDocsInterceptor extends AbstractInterceptor {

@Override
public Outcome handleRequest(Exchange exc) throws Exception {
if(!initialized) {
ruleApiSpecs = initializeRuleApiSpecs();
initialized = true;
synchronized(this) {
if (!initialized) {
ruleApiSpecs = initializeRuleApiSpecs();
initialized = true;
}
}
var publisher = new OpenAPIPublisher(ruleApiSpecs);

Expand Down

0 comments on commit f882c45

Please sign in to comment.