Skip to content

Commit

Permalink
Merge pull request cc-archive#486 from creativecommons/increase_sourc…
Browse files Browse the repository at this point in the history
…e_cache

Cache source count for 20 minutes instead of 10 seconds
  • Loading branch information
aldenstpage committed May 4, 2020
2 parents 42e4202 + e60973c commit 35e905a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from math import ceil

ELASTICSEARCH_MAX_RESULT_WINDOW = 10000
CACHE_TIMEOUT = 10
CACHE_TIMEOUT = 60 * 20
DEAD_LINK_RATIO = 1 / 2
THUMBNAIL = 'thumbnail'
URL = 'url'
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ services:

cache:
image: redis:4.0.10
container_name: cccatalog-api_cache_1
ports:
- "6379:6379"

Expand Down
2 changes: 2 additions & 0 deletions load_sample_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ PGPASSWORD=deploy psql -U deploy -d openledger -h localhost -p 5433 -c "\copy im
curl -XPOST localhost:8001/task -H "Content-Type: application/json" -d '{"model": "image", "action": "LOAD_TEST_DATA"}'
# Ingest and index the data
curl -XPOST localhost:8001/task -H "Content-Type: application/json" -d '{"model": "image", "action": "INGEST_UPSTREAM"}'
# Clear source cache since it's out of date after data has been loaded
docker exec -it cccatalog-api_cache_1 /bin/bash -c "echo \"del :1:providers-image\" | redis-cli"

0 comments on commit 35e905a

Please sign in to comment.