Skip to content

Releases: gqylpy/funccache

2.0.4

10 Oct 01:13
e579c85
Compare
Choose a tag to compare
  1. Fix a critical error.
  2. Improve a few type annotations.

  1. 修复一个严重的错误。
  2. 改进少量类型注解。

What's Changed

Full Changelog: 2.0.3...2.0.4

1.6.0

08 Oct 02:28
41e5a1f
Compare
Choose a tag to compare
  1. The scheme of reconstructing the return value of the cache function, uses the secondary lock. Solve the lock contention problem when the function is called concurrently with different parameters.
  2. The return value of the method in the cache class supports setting the expiration time.
  3. Add a decorator named count, supports caching the return value of a function by number of calls.
  4. The decorator with cache expiration expires is renamed to ttl.
  5. The cache expiration time parameter can be passed in unit-time (such as "1h40m").
  6. Fix issue: When an exception occurs in the call to the cached object, subsequent successive calls always raise KeyError: '__return__'. #2
  7. Fix issue: Concurrent calls when the return value of the function has not been cached or has expired may repeat the execution of the function. #4
  8. The __getattribute__ method is no longer silently overridden, and an exception is thrown directly if it exists.
  9. Internal code adds type annotations, as well as a lot of optimization and refactoring.
  10. Refactor the internal method Time2Second to make it more concise and efficient.
  11. Use time.monotonic() to replace time.time() for cache expiration checks.
  12. Fix the potential errors that may occur in the class cache when running in performance mode.

  1. 重构缓存函数返回值的方案,现采用二级锁。解决以不同参数并发调用函数时的锁竞争问题。
  2. 缓存类中方法的返回值支持设置过期时间。
  3. 新增装饰器 count,支持按调用次数缓存函数的返回值。
  4. 带缓存有效期的装饰器 expires 更名为 ttl
  5. 缓存过期时间的参数支持按单位时间(如 "1h40m")的方式传入。
  6. 修复问题:当被缓存的对象调用出现异常后,后续的连续调用始终引发 KeyError: '__return__'#2
  7. 修复问题:当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数。#4
  8. 不再静默覆盖 __getattribute__ 方法,如果它存在,将直接抛出异常。
  9. 内部代码添加类型注解,以及大量优化和重构。
  10. 重构内部方法 Time2Second 使之更简洁和高效。
  11. 使用 time.monotonic() 替换 time.time() 进行缓存过期检查。
  12. 修复在性能模式下运行时类缓存器可能发生的错误。

What's Changed

Full Changelog: 1.5.4...1.6.0

2.0.3

28 Aug 00:48
dcc078b
Compare
Choose a tag to compare
  1. Fix the potential errors that may occur in the class cache when running in performance mode.

  1. 修复在性能模式下运行时类缓存器可能发生的错误。

2.0.2

26 Jul 02:41
f072cf2
Compare
Choose a tag to compare
  1. Correct a consecutive judgment error in the code.
  2. Refactor the internal method Time2Second to make it more concise and efficient.
  3. Use time.monotonic() to replace time.time() for cache expiration checks.
  4. Adjust the formatting and annotations of other minor code sections.

  1. 修正代码中的一个连续判断错误。
  2. 重构内部方法 Time2Second 使之更简洁和高效。
  3. 使用 time.monotonic() 替换 time.time() 进行缓存过期检查。
  4. 调整其它少量代码格式和注解。

What's Changed

Full Changelog: 2.0.1...2.0.2

2.0.1

15 Apr 01:13
5107b73
Compare
Choose a tag to compare
  1. A small amount of code optimization.
  2. Correct the Chinese document link.
  3. Correct the brief description information on PyPi.

  1. 少量的代码优化。
  2. 更正中文文档链接。
  3. 更正在 PyPi 上的简述信息。

2.0

07 Apr 01:41
Compare
Choose a tag to compare
2.0
  1. Officially release version. 2.0alpha1

  1. 正式发布版本。2.0alpha1

2.0alpha1

01 Apr 02:09
8d7156f
Compare
Choose a tag to compare
2.0alpha1 Pre-release
Pre-release
  1. Note: This version is a refactored version and many changes are not backward compatible.
  2. The scheme of reconstructing the return value of the cache function, uses the secondary lock. Solve the lock contention problem when the function is called concurrently with different parameters.
  3. The return value of the method in the cache class supports setting the expiration time.
  4. Add a decorator named count, supports caching the return value of a function by number of calls.
  5. The decorator with cache expiration expires is renamed to ttl.
  6. The cache expiration time parameter can be passed in unit-time (such as "1h40m").
  7. Fix issue: When an exception occurs in the call to the cached object, subsequent successive calls always raise KeyError: '__return__'. #2
  8. Fix issue: Concurrent calls when the return value of the function has not been cached or has expired may repeat the execution of the function. #4
  9. The __getattribute__ method is no longer silently overridden, and an exception is thrown directly if it exists.
  10. Internal code adds type annotations, as well as a lot of optimization and refactoring.
  11. Python3.6 and 3.7 are no longer supported.

  1. 注意:此版本为重构版本,大量改动不向下兼容。
  2. 重构缓存函数返回值的方案,现采用二级锁。解决以不同参数并发调用函数时的锁竞争问题。
  3. 缓存类中方法的返回值支持设置过期时间。
  4. 新增装饰器 count,支持按调用次数缓存函数的返回值。
  5. 带缓存有效期的装饰器 expires 更名为 ttl
  6. 缓存过期时间的参数支持按单位时间(如 "1h40m")的方式传入。
  7. 修复问题:当被缓存的对象调用出现异常后,后续的连续调用始终引发 KeyError: '__return__'#2
  8. 修复问题:当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数。#4
  9. 不再静默覆盖 __getattribute__ 方法,如果它存在,将直接抛出异常。
  10. 内部代码添加类型注解,以及大量优化和重构。
  11. Python3.6 和 3.7 版本不再受支持。

1.5.4

02 Oct 02:14
e88cb51
Compare
Choose a tag to compare
  1. Improve parameter annotations.
  2. The decorator expiration_time is about to be deprecated and replaced by expires
  3. Adjust the naming of multiple internal methods, classes, and parameters, the new naming is more intuitive and clear.

  1. 完善参数注解。
  2. 装饰器 expiration_time 即将弃用,取而代之的是 expires
  3. 调整多个内部方法,类和参数的命名,新的命名更加直观和清晰。

1.5.3

01 Jul 06:28
Compare
Choose a tag to compare
  1. Fix issue: When a cached object encounters an exception during invocation, the subsequent calls are consistently blocked. #1
  2. Optimize package release process and adjusting the categorization information of open-source libraries on PyPi.
  3. Normalize a small number of code segments.

1.修复问题:当被缓存的对象调用出现异常后,后续的调用始终阻塞。#1
2.优化包发布流程,并调整了在PyPi上的开源库分类信息。
3.发现少量代码段的规范性不足并调整。

1.5.2

29 Apr 02:29
Compare
Choose a tag to compare

1.Optimize logical blocks for real code imports.

1.优化真实代码导入的逻辑块。