mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 04:56:45 +00:00
fix: Q_CLUSTER is using the database for its broker
Q_CLUSTER is using the database as its broker, and adding cache configuration for it and not using it is pointless. But rather than change Q_CLUSTER's configuration to use redis as the broker, lets just leave it using the database as the database broker has its advantages.
This commit is contained in:
parent
825b1473b2
commit
561fd6afc1
@ -558,7 +558,7 @@ _cache_port = _cache_config.get(
|
|||||||
if _cache_host:
|
if _cache_host:
|
||||||
# We are going to rely upon a possibly non-localhost for our cache,
|
# We are going to rely upon a possibly non-localhost for our cache,
|
||||||
# so don't wait too long for the cache as nothing in the cache should be
|
# so don't wait too long for the cache as nothing in the cache should be
|
||||||
# irreplacable. Django Q Cluster will just try again later.
|
# irreplacable.
|
||||||
_cache_options = {
|
_cache_options = {
|
||||||
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||||
"SOCKET_CONNECT_TIMEOUT": int(os.getenv("CACHE_CONNECT_TIMEOUT", "2")),
|
"SOCKET_CONNECT_TIMEOUT": int(os.getenv("CACHE_CONNECT_TIMEOUT", "2")),
|
||||||
@ -584,15 +584,9 @@ if _cache_host:
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
CACHES = {
|
CACHES = {
|
||||||
# Connection configuration for Django Q Cluster
|
|
||||||
"worker": {
|
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
|
||||||
"LOCATION": f"redis://{_cache_host}:{_cache_port}/0",
|
|
||||||
"OPTIONS": _cache_options,
|
|
||||||
},
|
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
"LOCATION": f"redis://{_cache_host}:{_cache_port}/1",
|
"LOCATION": f"redis://{_cache_host}:{_cache_port}/0",
|
||||||
"OPTIONS": _cache_options,
|
"OPTIONS": _cache_options,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user