-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce clearNavigationCache() to clear children and titleResolver cache #2383
Conversation
clearNavigationCache() { | ||
NodeDataManagementStorage.deleteCache(); | ||
|
||
const clearTitleResolverCache = nodes => { | ||
if (nodes && nodes.forEach) { | ||
nodes.forEach(node => { | ||
if (node.titleResolver && node.titleResolver._cache) { | ||
node.titleResolver._cache = undefined; | ||
} | ||
if (node.children) { | ||
clearTitleResolverCache(node.children); | ||
} | ||
}); | ||
} | ||
}; | ||
|
||
clearTitleResolverCache(this.getConfig().navigation.nodes); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(q) We clear the cache of the nested navigation nodes - shouldn't we return a warning of some kind of any of the nodes do not meet the criteria (i.e. titleResolver doesn't exist in the node) within the if
s? I presume it makes no sense because we can only clean cache
s if the titleResolver already exists... but my questions stands - should we inform somehow anything/anybody that it's been cleaned or (not) cleaned? :)
…cache (SAP#2383) * Clear children and titleResolver cache * Update the description of clearNavigationCache()
Description
Provide a core API to clean nodeData cache for children resolution and titleResolver cache.
Luigi.clearNavigationCache()
Related issue(s)
Fixes #2379
Draft PR: #2380