Changed default URI for Redis
This commit is contained in:
parent
a54ef39e53
commit
cda570eb37
6
classes/cache/holo_cache_redis.py
vendored
6
classes/cache/holo_cache_redis.py
vendored
@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from logging import Logger
|
from logging import Logger
|
||||||
from typing import Dict, Any, List
|
from typing import Dict, Any
|
||||||
|
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
|
|
||||||
@ -25,9 +25,7 @@ class HoloCacheRedis(HoloCache):
|
|||||||
"Cache configuration is invalid. Please check if all keys are set (engine: memcached)"
|
"Cache configuration is invalid. Please check if all keys are set (engine: memcached)"
|
||||||
)
|
)
|
||||||
|
|
||||||
uri_split: List[str] = engine_config["uri"].split(":")
|
return cls(Redis.from_url(engine_config["uri"]))
|
||||||
|
|
||||||
return cls(Redis(host=uri_split[0], port=int(uri_split[1])))
|
|
||||||
|
|
||||||
def get_json(self, key: str) -> Any | None:
|
def get_json(self, key: str) -> Any | None:
|
||||||
try:
|
try:
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
"uri": "127.0.0.1:11211"
|
"uri": "127.0.0.1:11211"
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
"uri": "127.0.0.1:6379"
|
"uri": "redis://127.0.0.1:6379/0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"logging": {
|
"logging": {
|
||||||
|
@ -15,7 +15,7 @@ class Migration(BaseMigration):
|
|||||||
{
|
{
|
||||||
"type": None,
|
"type": None,
|
||||||
"memcached": {"uri": "127.0.0.1:11211"},
|
"memcached": {"uri": "127.0.0.1:11211"},
|
||||||
"redis": {"uri": "127.0.0.1:6379"},
|
"redis": {"uri": "redis://127.0.0.1:6379/0"},
|
||||||
},
|
},
|
||||||
*[],
|
*[],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user