Skip to content

Commit

Permalink
Don't validate plugin's config every time it's read
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Jun 4, 2020
1 parent fa04609 commit cc98fa6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/server/plugins/plugin_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { map } from 'rxjs/operators';
import { map, shareReplay } from 'rxjs/operators';
import { combineLatest } from 'rxjs';
import { CoreContext } from '../core_context';
import { PluginWrapper } from './plugin';
Expand Down Expand Up @@ -107,8 +107,8 @@ export function createPluginInitializerContext(
* @param ConfigClass A class (not an instance of a class) that contains a
* static `schema` that we validate the config at the given `path` against.
*/
create() {
return coreContext.configService.atPath(pluginManifest.configPath);
create<T>() {
return coreContext.configService.atPath<T>(pluginManifest.configPath).pipe(shareReplay(1));
},
createIfExists() {
return coreContext.configService.optionalAtPath(pluginManifest.configPath);
Expand Down

0 comments on commit cc98fa6

Please sign in to comment.