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 (#1187)
  • Loading branch information
t-burch authored Jul 12, 2024
1 parent 8b06e72 commit af117df
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 af117df

Please sign in to comment.