diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-10 15:37:32 -0500 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-10 17:54:53 -0500 |
commit | b96d9ed4b615e4f6c9d6b4db6679fb843c5319e7 (patch) | |
tree | 98cfcb6874ea7d3a16d536dfeb2d3aad3b0c4c74 /examples | |
parent | 8fa9c24b23d143db645cf24a24764597b04caccc (diff) | |
download | requests-cache-b96d9ed4b615e4f6c9d6b4db6679fb843c5319e7.tar.gz |
Add indexed datetime column to SQLite backend for faster eviction
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/generate_test_db.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/generate_test_db.py b/examples/generate_test_db.py index 397a3d9..a68b7ee 100755 --- a/examples/generate_test_db.py +++ b/examples/generate_test_db.py @@ -16,9 +16,12 @@ from requests_cache import ALL_METHODS, CachedResponse, CachedSession from requests_cache.models.response import format_file_size from tests.conftest import HTTPBIN_FORMATS, HTTPBIN_METHODS -# TODO: If others would find it useful, these settings could be turned into CLI args BACKEND = 'sqlite' CACHE_NAME = 'rubbish_bin' +MAX_EXPIRE_AFTER = 30 # In seconds; set to -1 to disable expiration +MAX_RESPONSE_SIZE = 10000 # In bytes +N_RESPONSES = 100000 +N_INVALID_RESPONSES = 10 BASE_RESPONSE = requests.get('https://httpbin.org/get') HTTPBIN_EXTRA_ENDPOINTS = [ @@ -28,11 +31,6 @@ HTTPBIN_EXTRA_ENDPOINTS = [ 'redirect/5', 'stream-bytes/1024', ] -MAX_EXPIRE_AFTER = 30 # In seconds; set to -1 to disable expiration -MAX_RESPONSE_SIZE = 10000 # In bytes -N_RESPONSES = 100000 -N_INVALID_RESPONSES = 10 - logging.basicConfig(level='INFO') logger = logging.getLogger('requests_cache') |