Skip to content

Commit

Permalink
hotfix/fix caching issue (#101)
Browse files Browse the repository at this point in the history
* Update certs

* Fix clearing of cache

* Fix linting issue
  • Loading branch information
nathanfranklin authored Apr 17, 2023
1 parent cd07916 commit f4d10ee
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions protx/scripts/run_queries.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from protx.api import get_maltreatment_cached, get_demographics_cached_and_compressed, get_resources_cached_and_compressed
from protx.decorators import cache
from protx.utils.db import resources_db, cooks_db
import time
import argparse
functions_to_cache = [get_maltreatment_cached, get_demographics_cached_and_compressed, get_resources_cached_and_compressed]
Expand All @@ -21,10 +20,9 @@ def call_function_and_report(f):
args = parser.parse_args()
config = vars(args)
if config['clear_cache']:
dbs = [cooks_db, resources_db]
print(f"Clearing existing cache related to databases: {dbs}")
for db in dbs:
cache.evict(db)
print("Clearing cache...")
count = cache.clear()
print(f"Removed {count} items")

print(f" Running {len(functions_to_cache)} methods in order to cache their results")

Expand Down

0 comments on commit f4d10ee

Please sign in to comment.