// node-redis to promise, because node-redis not support promise
import bluebird from 'bluebird'
import { Commands, createClient } from 'redis'
const client = createClient({
host: process.env.REDIS_HOST,
port: parseInt(process.env.REDIS_PORT),
password: process.env.REDIS_PASSWORD
})
let redisCon: Commands<any>
;(async (redis) => {
const redisPromise = await bluebird.resolve<Commands<any>>(redis)
redisCon = redisPromise
})(client)
export { redisCon }