# coding: utf-8
import redis

class RedisClient:
    _instance = None

    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(RedisClient, cls).__new__(cls)
            cls._instance._initialize(*args, **kwargs)
        return cls._instance

    def _initialize(self, host='39.108.185.244', port=6379, db=12, password="khd2022!", decode_responses=True):
        self.client = redis.StrictRedis(host=host, port=port, db=db, password=password,
                                        decode_responses=decode_responses)

    def get_client(self):
        return self.client