Skip to content

Commit

Permalink
return cache as promise
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnetanninen committed Mar 15, 2018
1 parent 2a55ef7 commit 2722b94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/render-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function getHearingDataCached(settings, hearingSlug, ttl = 30 * 60 * 1000) {
hearingDataCache[hearingSlug] && // in cache
now < hearingDataCache[hearingSlug].ts + ttl // not expired yet
) {
return hearingDataCache[hearingSlug].data;
return Promise.resolve(hearingDataCache[hearingSlug].data);
}
return fetch(
`${settings.kerrokantasi_api_base}/v1/hearing/${hearingSlug}`
Expand Down

0 comments on commit 2722b94

Please sign in to comment.