ci: redis credentials only on production
This commit is contained in:
parent
15425cdc32
commit
94cf57cfda
@ -1,9 +1,15 @@
|
||||
import { createClient } from 'redis'
|
||||
|
||||
export const redis = createClient({
|
||||
password: import.meta.env.REDIS_PASSWORD,
|
||||
url: import.meta.env.REDIS_URL,
|
||||
})
|
||||
const getRedisOptions = () => {
|
||||
if (import.meta.env.NODE_ENV !== 'production') {
|
||||
return {
|
||||
password: import.meta.env.REDIS_PASSWORD,
|
||||
url: import.meta.env.REDIS_URL,
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
export const redis = createClient(getRedisOptions())
|
||||
|
||||
redis.on('error', (err) => console.log('Redis Client Error', err))
|
||||
await redis.connect()
|
||||
|
Loading…
Reference in New Issue
Block a user