From e16ca335debefa5eec47b2d3f3cb62dbc1eb32ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Fri, 13 Sep 2019 10:16:36 +0200 Subject: [PATCH] Updated requirements - Added websockets to production.txt - Import channels_redis in redis.py only for big mode (if use_redis=true) --- openslides/utils/redis.py | 7 ++++--- requirements/big_mode.txt | 2 +- requirements/production.txt | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/openslides/utils/redis.py b/openslides/utils/redis.py index e96dd68a2..9744ee5fe 100644 --- a/openslides/utils/redis.py +++ b/openslides/utils/redis.py @@ -1,7 +1,6 @@ import asyncio from typing import Any -from channels_redis.core import ConnectionPool from django.conf import settings from . import logging @@ -14,14 +13,16 @@ try: except ImportError: use_redis = False else: + from channels_redis.core import ConnectionPool + # set use_redis to true, if there is a value for REDIS_ADDRESS in the settings redis_address = getattr(settings, "REDIS_ADDRESS", "") use_redis = bool(redis_address) if use_redis: logger.info(f"Redis address {redis_address}") -pool = ConnectionPool({"address": redis_address}) -counter = 0 + pool = ConnectionPool({"address": redis_address}) + counter = 0 class RedisConnectionContextManager: diff --git a/requirements/big_mode.txt b/requirements/big_mode.txt index 456525859..4b89a3b1f 100644 --- a/requirements/big_mode.txt +++ b/requirements/big_mode.txt @@ -6,4 +6,4 @@ aioredis>=1.1.0,<1.3 # Requirements for fast asgi server gunicorn>=19.9.0,<20 -uvicorn>=0.3.2,<1.1 +uvicorn>=0.9,<1.0 diff --git a/requirements/production.txt b/requirements/production.txt index cb9e07044..76231f0d9 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -15,3 +15,4 @@ PyPDF2>=1.26,<1.27 roman>=2.0,<3.2 setuptools>=29.0,<42.0 typing_extensions>=3.6.6,<3.8 +websockets>=8.0,<9.0 \ No newline at end of file