MCPcopy
hub / github.com/omkarcloud/botasaurus / _get_item_modified_time

Method _get_item_modified_time

botasaurus/cache.py:376–391  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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,

Callers 1

is_item_older_thanMethod · 0.80

Calls 4

_get_cache_pathFunction · 0.85
_hasFunction · 0.70
CacheMissExceptionClass · 0.70

Tested by

no test coverage detected