refactor: register plugin application context after context refreshed (#4092)

#### What type of PR is this?
/kind improvement
/area core
/area plugin

#### What this PR does / why we need it:
插件的 ApplicationContext 刷新之后在注册到 Registry 中

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/4061/head
guqing 2023-06-26 21:31:59 +08:00 committed by GitHub
parent 34d0f9369b
commit 532d7e0632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,6 @@ public class PluginApplicationInitializer {
log.debug("Total millis: {} ms -> {}", stopWatch.getTotalTimeMillis(),
stopWatch.prettyPrint());
contextRegistry.register(pluginId, pluginApplicationContext);
return pluginApplicationContext;
}
@ -126,6 +125,8 @@ public class PluginApplicationInitializer {
pluginApplicationContext.refresh();
stopWatch.stop();
contextRegistry.register(pluginId, pluginApplicationContext);
log.debug("initApplicationContext total millis: {} ms -> {}",
stopWatch.getTotalTimeMillis(), stopWatch.prettyPrint());
}