diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6f3a66fd..0bd7726f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,4 +17,4 @@ jobs: - run: flake8 # To local srcs, we must specifically exclude src - - run: black --check --exclude "/(\.eggs|\.git|_cache|src)/" ./ + - run: black --check --exclude "/(\.eggs|\.git|_cache|src|.ve)/" ./ diff --git a/datastore/api/dashboard/api.py b/datastore/api/dashboard/api.py index cee489be..4823c64d 100644 --- a/datastore/api/dashboard/api.py +++ b/datastore/api/dashboard/api.py @@ -88,6 +88,7 @@ def get(self, *args, **kwargs): ret = quality_data.generate_stats(mode, source_file_set) - cache.set(full_request_uri, ret) + # As cache is cleared on a pipeline run, set without a timeout + cache.set(full_request_uri, ret, timeout=None) return JsonResponse(ret, safe=False) diff --git a/tools/data_run.sh b/tools/data_run.sh index fce83c8f..a05350f6 100755 --- a/tools/data_run.sh +++ b/tools/data_run.sh @@ -35,6 +35,7 @@ else MAX_TOTAL_RUNS_IN_DB=31 # Based on running this script each day and Keep a few extra for safety MAX_PACKAGE_AGE_DAYS=`expr $MAX_TOTAL_RUNS_IN_DB + 2` + DASHBOARD_HOST=localhost:8000 ### End CONFIG ### PERFORMANCE_CSV=~/data_run_profile.csv fi @@ -100,6 +101,12 @@ profile_block_stop "REWRITE_QUALITY_DATA" ./datastore/manage.py set_status --what datastore --status IDLE +## +## Warm the dashboard endpoints cache for the DQD +## +curl -s -o /dev/null "https://$DASHBOARD_HOST/api/dashboard/overview?mode=publishers" || true +curl -s -o /dev/null "https://$DASHBOARD_HOST/api/dashboard/overview?mode=grants" || true + ## ## Clean up before creating the GrantNav data package. ##