@@ -63,6 +63,13 @@ def obj_exists(self, key: ObjectStorageProvider_KeyType) -> bool:
6363 Check whether a given object exists in storage.
6464 """
6565
66+ @abstractmethod
67+ def mtime (self , key : ObjectStorageProvider_KeyType ) -> float :
68+ """
69+ Return the last modified time in seconds since the epoc for the object.
70+ If the object does not exist, an exception should be raised.
71+ """
72+
6673 @abstractmethod
6774 def obj_rename (self , src : ObjectStorageProvider_KeyType , dst : ObjectStorageProvider_KeyType ) -> None :
6875 """
@@ -181,6 +188,10 @@ def obj_exists(self, key: ObjectStorageProvider_KeyType) -> bool:
181188 obj_filepath = self ._obj_filepath (key )
182189 return obj_filepath .exists ()
183190
191+ def mtime (self , key : ObjectStorageProvider_KeyType ) -> float :
192+ obj_filepath = self ._obj_filepath (key )
193+ return obj_filepath .stat ().st_mtime
194+
184195 def obj_rename (self , src : ObjectStorageProvider_KeyType , dst : ObjectStorageProvider_KeyType ) -> None :
185196 src_filepath = self ._obj_filepath (src )
186197 dst_filepath = self ._obj_filepath (dst )
@@ -493,7 +504,7 @@ def lazy_reload(self):
493504 # Have data. No path. Continue with in memory value.
494505 return
495506
496- if int ( self ._file_path . stat (). st_mtime ) > self ._load_time :
507+ if self ._object_storage_provider . mtime ( self . _file_path ) > self ._load_time :
497508 self .load ()
498509
499510 def lazy_get (self , field ):
0 commit comments