Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistency due to rounding in CachedResponse.expires_unix property #980

Merged
merged 1 commit into from Mar 19, 2024

Conversation

JWCook
Copy link
Member

@JWCook JWCook commented Mar 19, 2024

Closes #975

Example to manually verify consistency:

from requests_cache import CachedResponse
from datetime import datetime

r = CachedResponse(expires=datetime.now())
timestamps = {r.expires_unix for _ in range(10000000)}
assert len(set(timestamps)) == 1

@JWCook JWCook added the bug label Mar 19, 2024
@JWCook JWCook added this to the v1.2 milestone Mar 19, 2024
@JWCook JWCook changed the title Fix rounding error in CachedResponse.expires_unix property Fix inconsistency due to rounding in CachedResponse.expires_unix property Mar 19, 2024
@JWCook JWCook merged commit 39cadc7 into main Mar 19, 2024
8 checks passed
@JWCook JWCook deleted the unix-time branch March 19, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expires_unix is not giving consistent results
1 participant