Skip to content

Commit

Permalink
support disabled cache
Browse files Browse the repository at this point in the history
  • Loading branch information
philippdormann committed Sep 27, 2022
1 parent 852d0f8 commit e531893
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ function getMensaplanHTML({ p, e }) {
return ins.project === p && ins.facility === e;
});
if (found) {
if (process.env.CACHE === 'NONE') {
return fetch({ p, e });
if (process.env.CACHE === 'none') {
fetchHTML({ p, e, provider: found.provider }).then(
(data) => {
resolve(data);
}
);
} else {
const cacheTimeMinutes = parseInt(
process.env.CACHE_TIME_MINUTES || 1
Expand Down

0 comments on commit e531893

Please sign in to comment.