Private function to get the timestamp when cache was stored. Returns the modification time of the cache file as a datetime object.
(func, key_data)
| 374 | |
| 375 | @staticmethod |
| 376 | def _get_item_modified_time(func, key_data): |
| 377 | """ |
| 378 | Private function to get the timestamp when cache was stored. |
| 379 | Returns the modification time of the cache file as a datetime object. |
| 380 | """ |
| 381 | from datetime import datetime |
| 382 | |
| 383 | _create_cache_directory_if_not_exists(func) |
| 384 | path = _get_cache_path(func, key_data) |
| 385 | |
| 386 | if not _has(path): |
| 387 | raise CacheMissException(path) |
| 388 | |
| 389 | # Get file modification time |
| 390 | timestamp = os.path.getmtime(path) |
| 391 | return datetime.fromtimestamp(timestamp) |
| 392 | |
| 393 | @staticmethod |
| 394 | def is_item_older_than(func, key_data, days=0, seconds=0, microseconds=0, |
no test coverage detected