-
Suggestion
-
Resolution: Won't Do
-
None
NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.
The bit of code:
public PluginSettings createSettingsForKey(final String key) { Supplier<? extends PropertySet> propertySet = null; if (key != null) { propertySet = Suppliers.memoize(LazyProjectMigratingPropertySet.create(projectManager, jiraPropertySetFactory, jiraPropertySetFactory.buildCachingDefaultPropertySet(key, true), key)); } else { ... } return new JiraPluginSettings(propertySet); }
When the project key is passed in the parameter, this will always call jiraPropertySetFactory.buildCachingDefaultPropertySet(key, true) first, which will build the NON-caching property set and eagerly load it.
Since this is project key related, the client code is unlikely to keep a reference to it other than using it as a local variable, it would be great if the result is cached in the request thread locals, as many plugins may have to call this when serving the same request.
Attached is an inCallOrder recorded for one request that has the plugin settings for project 'BMW' loaded for dozen of times.
- is related to
-
JRASERVER-25969 JiraPluginSettingsFactory.createSettingsForKey(projectKey) should not load eagerly and the result should be cached for the rest of the request
- Closed