yuqi1129 commented on code in PR #5997:
URL: https://github.com/apache/gravitino/pull/5997#discussion_r1904069465


##########
clients/client-python/gravitino/filesystem/gvfs.py:
##########
@@ -866,50 +894,93 @@ def _get_fileset_catalog(self, catalog_ident: 
NameIdentifier):
         finally:
             write_lock.release()
 
-    def _get_filesystem(self, actual_file_location: str):
+    # Disable Too many branches (13/12) (too-many-branches)
+    # pylint: disable=R0912
+    def _get_filesystem(
+        self,
+        actual_file_location: str,
+        fileset_catalog: Catalog,
+        name_identifier: NameIdentifier,
+    ):
         storage_type = self._recognize_storage_type(actual_file_location)
         read_lock = self._cache_lock.gen_rlock()
         try:
             read_lock.acquire()
-            cache_value: Tuple[StorageType, AbstractFileSystem] = 
self._cache.get(
-                storage_type
+            cache_value: Tuple[int, AbstractFileSystem] = self._cache.get(
+                name_identifier
             )
             if cache_value is not None:
-                return cache_value
+                # if the cache value is not expired, return the cache value
+                if cache_value[0] > time.time() * 1000:
+                    return cache_value[1]
         finally:
             read_lock.release()
 
         write_lock = self._cache_lock.gen_wlock()
         try:
             write_lock.acquire()
-            cache_value: Tuple[StorageType, AbstractFileSystem] = 
self._cache.get(
-                storage_type
+            cache_value: Tuple[int, AbstractFileSystem] = self._cache.get(
+                name_identifier
             )
+
             if cache_value is not None:
-                return cache_value
+                # if the cache value is not expired, return the cache value
+                if cache_value[0] > time.time() * 1000:

Review Comment:
   I have handled it. see 
   <img width="792" alt="image" 
src="https://github.com/user-attachments/assets/c25ec5de-6d47-45f3-a6fb-84fcc02d89c9";
 />
   
   
   > nd could you use a function to check whether the token expires?
   
   ok
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to