1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

turn off withCache for tests

This commit is contained in:
Martin McKeaveney 2022-05-23 00:29:45 +01:00
parent 9483712c7e
commit 58a5c3d82b

View file

@ -1,5 +1,6 @@
const { Client, utils } = require("@budibase/backend-core/redis")
const { newid } = require("@budibase/backend-core/utils")
const env = require("../environment")
function getExpirySecondsForDB(db) {
switch (db) {
@ -119,7 +120,9 @@ exports.withCache = async (key, ttl, fetchFn) => {
try {
const fetchedValue = await fetchFn()
await cachingClient.store(key, fetchedValue, ttl)
if (!env.isTest()) {
await cachingClient.store(key, fetchedValue, ttl)
}
return fetchedValue
} catch (err) {
console.error("Error calling fetch function", err)