diff --git a/vulnerabilities/templates/pipeline_dashboard.html b/vulnerabilities/templates/pipeline_dashboard.html
index 826c614ea..61c479126 100644
--- a/vulnerabilities/templates/pipeline_dashboard.html
+++ b/vulnerabilities/templates/pipeline_dashboard.html
@@ -86,13 +86,13 @@
Pipeline Dashboard
worker{{ additional|pluralize }} for the {{ queue_name }} queue.">
- {% elif load_factor < 1 %}
+ {% elif additional < 1 %}
{{ load_factor|floatformat:2 }}
- {% elif load_factor < 1.6 %}
+ {% elif additional < 2 %}
{{ load_factor|floatformat:2 }}
diff --git a/vulnerabilities/views.py b/vulnerabilities/views.py
index 371dcd217..3aff06768 100644
--- a/vulnerabilities/views.py
+++ b/vulnerabilities/views.py
@@ -59,8 +59,6 @@
PAGE_SIZE = 10
-CACHE_TIMEOUT = 60 * 5
-
class VulnerableCodeView(View):
"""
@@ -965,11 +963,12 @@ def get_queryset(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
+ cache_timeout = 60 * 10
load_per_queue = cache.get("load_per_queue")
if load_per_queue is None:
load_per_queue = compute_queue_load_factor()
- cache.set("load_per_queue", load_per_queue, CACHE_TIMEOUT)
+ cache.set("load_per_queue", load_per_queue, cache_timeout)
context["load_per_queue"] = load_per_queue
context["active_pipeline_count"] = PipelineSchedule.objects.filter(is_active=True).count()
diff --git a/vulnerablecode/settings.py b/vulnerablecode/settings.py
index 8ec5f6e31..e14c923cf 100644
--- a/vulnerablecode/settings.py
+++ b/vulnerablecode/settings.py
@@ -402,6 +402,18 @@
}
+vcio_redis_host = env.str("VULNERABLECODE_REDIS_HOST", default=None)
+vcio_redis_port = env.str("VULNERABLECODE_REDIS_PORT", default=None)
+
+if vcio_redis_host and vcio_redis_port:
+ CACHES = {
+ "default": {
+ "BACKEND": "django.core.cache.backends.redis.RedisCache",
+ "LOCATION": f"redis://{vcio_redis_host}:{vcio_redis_port}",
+ }
+ }
+
+
# FederatedCode integration
FEDERATEDCODE_VULNERABILITIES_REPO = env.str(