summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-10 15:37:32 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-10 17:54:53 -0500
commitb96d9ed4b615e4f6c9d6b4db6679fb843c5319e7 (patch)
tree98cfcb6874ea7d3a16d536dfeb2d3aad3b0c4c74 /examples
parent8fa9c24b23d143db645cf24a24764597b04caccc (diff)
downloadrequests-cache-b96d9ed4b615e4f6c9d6b4db6679fb843c5319e7.tar.gz
Add indexed datetime column to SQLite backend for faster eviction
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/generate_test_db.py10
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')