From eecd477a341b08aa6b83729110607d7fc85a582f Mon Sep 17 00:00:00 2001 From: Nigel Date: Tue, 2 Nov 2021 16:07:29 -0600 Subject: [PATCH] Add redis cache to postgres testcase --- .github/workflows/postgresql.yaml | 6 ++++++ InvenTree/InvenTree/settings.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/postgresql.yaml b/.github/workflows/postgresql.yaml index 9a56382c4e..d3354f3a37 100644 --- a/.github/workflows/postgresql.yaml +++ b/.github/workflows/postgresql.yaml @@ -27,6 +27,7 @@ jobs: INVENTREE_DEBUG: info INVENTREE_MEDIA_ROOT: ./media INVENTREE_STATIC_ROOT: ./static + INVENTREE_CACHE_HOST: localhost services: postgres: @@ -37,6 +38,11 @@ jobs: ports: - 5432:5432 + redis: + image: redis + ports: + - 6379:6379 + steps: - name: Checkout Code uses: actions/checkout@v2 diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 2a0227400e..b425a1c41e 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -541,7 +541,9 @@ DATABASES = { _cache_config = CONFIG.get("cache", {}) _cache_host = _cache_config.get("host", os.getenv("INVENTREE_CACHE_HOST")) -_cache_port = _cache_config.get("port", os.getenv("INVENTREE_CACHE_PORT")) +_cache_port = _cache_config.get( + "port", os.getenv("INVENTREE_CACHE_PORT", "6379") +) if _cache_host: # We are going to rely upon a possibly non-localhost for our cache,