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