respect custom redis uri
enable usage of app.config["REDIS_URI"]
This commit is contained in:
@@ -228,8 +228,9 @@ class RedisSessionInterface(SessionInterface):
|
|||||||
"""
|
"""
|
||||||
if self.backend is None:
|
if self.backend is None:
|
||||||
import aioredis
|
import aioredis
|
||||||
|
uri = app.config["REDIS_URI"] if "REDIS_URI" in app.config else "redis://localhost"
|
||||||
self.backend = await aioredis.from_url(
|
self.backend = await aioredis.from_url(
|
||||||
"redis://localhost", encoding="utf-8", decode_responses=True
|
uri, encoding="utf-8", decode_responses=True
|
||||||
)
|
)
|
||||||
|
|
||||||
async def get(self, key: str, app: Quart = None):
|
async def get(self, key: str, app: Quart = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user