Skip to content

Commit

Permalink
MID-8968: Synchronize initialization of application context
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Tkáčik <tonydamage@gmail.com>
(cherry picked from commit 9a7278f)
  • Loading branch information
tonydamage authored and 1azyman committed Aug 14, 2023
1 parent f8aa3d1 commit 6f76102
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ public void setLog(Log log) {
this.log = log;
}

private void setupRepositoryViaMidPointHome(ConnectionOptions options) {
private synchronized void setupRepositoryViaMidPointHome(ConnectionOptions options) {
if (applicationContext != null) {
// Guard if method is entered multiple times during multi-threaded invocation
return;
}
if (applicationContextLevel == NinjaApplicationContextLevel.NONE) {
throw new IllegalStateException("Application context shouldn't be initialized");
}
Expand Down

0 comments on commit 6f76102

Please sign in to comment.