From 879db37f5f01fef24911cd8422f9ac3797976397 Mon Sep 17 00:00:00 2001 From: Kylmakalle Date: Sun, 2 Jul 2017 03:40:24 +0300 Subject: [PATCH] Redis connection fix --- bot.py | 3 ++- vk_messages.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 5253700..97a7098 100644 --- a/bot.py +++ b/bot.py @@ -23,7 +23,8 @@ vk_dialogs = {} FILE_URL = 'https://api.telegram.org/file/bot{0}/{1}' -vk_tokens = redis.from_url(os.environ.get("REDIS_URL")) +tokens_pool = redis.ConnectionPool(host='localhost', port=6379, db=0) +vk_tokens = redis.StrictRedis(connection_pool=tokens_pool) currentchat = {} diff --git a/vk_messages.py b/vk_messages.py index 07586b2..09de34d 100644 --- a/vk_messages.py +++ b/vk_messages.py @@ -6,7 +6,8 @@ import traceback import vk import wget -vk_tokens = redis.from_url(os.environ.get("REDIS_URL")) +tokens_pool = redis.ConnectionPool(host='localhost', port=6379, db=0) +vk_tokens = redis.StrictRedis(connection_pool=tokens_pool) class VkPolling: