Chore: Change so we cache loading plugins by its version (#41367)

* making it possible to cache plugins based on the version.

* feat(plugincache): introduce function to invalidate entries

* removed todo's

* added tests for the cache buster.

* fixed tests.

* fixed failing tests.

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
Marcus Andersson
2021-11-10 11:54:58 +01:00
committed by GitHub
parent baab021fec
commit e5421dd53e
10 changed files with 138 additions and 21 deletions

View File

@@ -126,8 +126,8 @@ export class GrafanaApp {
// Preload selected app plugins
const promises: Array<Promise<any>> = [];
for (const modulePath of config.pluginsToPreload) {
promises.push(importPluginModule(modulePath));
for (const plugin of config.pluginsToPreload) {
promises.push(importPluginModule(plugin.path, plugin.version));
}
await Promise.all(promises);