Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /freqtrade_freqtrade /freqtrade /util /periodic_cache.py
| from datetime import UTC, datetime | |
| from cachetools import TTLCache | |
| class PeriodicCache(TTLCache): | |
| """ | |
| Special cache that expires at "straight" times | |
| A timer with ttl of 3600 (1h) will expire at every full hour (:00). | |
| """ | |
| def __init__(self, maxsize, ttl, getsizeof=None): | |
| def local_timer(): | |
| ts = datetime.now(UTC).timestamp() | |
| offset = ts % ttl | |
| return ts - offset | |
| # Init with smlight offset | |
| super().__init__(maxsize=maxsize, ttl=ttl - 1e-5, timer=local_timer, getsizeof=getsizeof) | |
Xet Storage Details
- Size:
- 564 Bytes
- Xet hash:
- 9944aedc2cc1321c5cc69e753b1457bc44128c0f75617c864210960b8953ea4e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.