MCPcopy Index your code
hub / github.com/simstudioai/sim / getStorageMethod

Function getStorageMethod

apps/sim/lib/core/storage/storage.ts:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 * If Redis is configured but fails, operations will fail (not fallback to DB).
19 */
20export function getStorageMethod(): StorageMethod {
21 if (cachedStorageMethod) {
22 return cachedStorageMethod
23 }
24
25 const redis = getRedisClient()
26
27 if (redis) {
28 cachedStorageMethod = 'redis'
29 logger.info('Storage method: Redis')
30 } else {
31 cachedStorageMethod = 'database'
32 logger.info('Storage method: PostgreSQL')
33 }
34
35 return cachedStorageMethod
36}
37
38/**
39 * Check if Redis is the configured storage method.

Callers 9

storeOTPFunction · 0.90
getOTPFunction · 0.90
incrementOTPAttemptsFunction · 0.90
deleteOTPFunction · 0.90
constructorMethod · 0.90
createStorageAdapterFunction · 0.90
getAdapterTypeFunction · 0.90
isRedisStorageFunction · 0.85
isDatabaseStorageFunction · 0.85

Calls 2

getRedisClientFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected