@@ -404,8 +404,6 @@ def _apply_object(
404
404
if not self .purge_feast_metadata :
405
405
self ._set_last_updated_metadata (update_datetime , project )
406
406
407
- self .refresh ()
408
-
409
407
def apply_permission (
410
408
self , permission : Permission , project : str , commit : bool = True
411
409
):
@@ -494,7 +492,6 @@ def _delete_object(
494
492
raise not_found_exception (name , project )
495
493
self ._set_last_updated_metadata (_utc_now (), project )
496
494
497
- self .refresh ()
498
495
return cursor .rowcount
499
496
500
497
def delete_permission (self , name : str , project : str , commit : bool = True ):
@@ -1128,6 +1125,18 @@ def process_project(project: Project):
1128
1125
project_name = project .name
1129
1126
last_updated_timestamp = project .last_updated_timestamp
1130
1127
1128
+ try :
1129
+ cached_project = self .get_project (project_name , True )
1130
+ except ProjectObjectNotFoundException :
1131
+ cached_project = None
1132
+
1133
+ allow_cache = False
1134
+
1135
+ if cached_project is not None :
1136
+ allow_cache = (
1137
+ last_updated_timestamp <= cached_project .last_updated_timestamp
1138
+ )
1139
+
1131
1140
r .projects .extend ([project .to_proto ()])
1132
1141
last_updated_timestamps .append (last_updated_timestamp )
1133
1142
@@ -1142,7 +1151,7 @@ def process_project(project: Project):
1142
1151
(self .list_validation_references , r .validation_references ),
1143
1152
(self .list_permissions , r .permissions ),
1144
1153
]:
1145
- objs : List [Any ] = lister (project_name , allow_cache = False ) # type: ignore
1154
+ objs : List [Any ] = lister (project_name , allow_cache ) # type: ignore
1146
1155
if objs :
1147
1156
obj_protos = [obj .to_proto () for obj in objs ]
1148
1157
for obj_proto in obj_protos :
0 commit comments