(cacheKey)
| 835 | // and either return the cached render for a cache hit, or render |
| 836 | // the panel for a cache miss |
| 837 | const getFromCacheOrRender = (cacheKey) => { |
| 838 | cache.get(cacheKey, (err, cachedData) => { |
| 839 | // We don't actually want to fail if the cache has an error; we'll |
| 840 | // just render the panel as normal |
| 841 | ERR(err, (e) => logger.error(e)); |
| 842 | if (!err && cachedData !== null) { |
| 843 | const { |
| 844 | courseIssues, |
| 845 | html, |
| 846 | renderedElementNames, |
| 847 | } = cachedData; |
| 848 | |
| 849 | const cacheHit = true; |
| 850 | callback(null, courseIssues, html, renderedElementNames, cacheHit); |
| 851 | } else { |
| 852 | doRender(cacheKey); |
| 853 | } |
| 854 | }); |
| 855 | }; |
| 856 | |
| 857 | if (locals.devMode) { |
| 858 | // In dev mode, we should skip caching so that we'll immediately |
no test coverage detected