mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1060 from TarasKindrat/master
Modify RedisHandlerBackend, add argument "password=None" to __init__()
This commit is contained in:
commit
bbcd7aa9db
@ -114,11 +114,11 @@ class FileHandlerBackend(HandlerBackend):
|
|||||||
|
|
||||||
|
|
||||||
class RedisHandlerBackend(HandlerBackend):
|
class RedisHandlerBackend(HandlerBackend):
|
||||||
def __init__(self, handlers=None, host='localhost', port=6379, db=0, prefix='telebot'):
|
def __init__(self, handlers=None, host='localhost', port=6379, db=0, prefix='telebot', password=None):
|
||||||
super(RedisHandlerBackend, self).__init__(handlers)
|
super(RedisHandlerBackend, self).__init__(handlers)
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
self.prefix = prefix
|
self.prefix = prefix
|
||||||
self.redis = Redis(host, port, db)
|
self.redis = Redis(host, port, db, password)
|
||||||
|
|
||||||
def _key(self, handle_group_id):
|
def _key(self, handle_group_id):
|
||||||
return ':'.join((self.prefix, str(handle_group_id)))
|
return ':'.join((self.prefix, str(handle_group_id)))
|
||||||
|
Loading…
Reference in New Issue
Block a user