@@ -46,7 +46,10 @@ public function discover(
4646 'Returning discovered entities from entity collection store. ' ,
4747 ['trustAnchorId ' => $ trustAnchorId ],
4848 );
49- return $ this ->entityCollectionFactory ->build ($ cachedEntities );
49+ return $ this ->entityCollectionFactory ->build (
50+ $ cachedEntities ,
51+ $ this ->entityCollectionStore ->getLastUpdated ($ trustAnchorId ),
52+ );
5053 }
5154 }
5255
@@ -56,6 +59,7 @@ public function discover(
5659 );
5760
5861 $ discoveredEntities = [];
62+ $ lastUpdated = null ;
5963 try {
6064 // Step 1: Fetch TA config
6165 $ taConfig = $ this ->entityStatementFetcher ->fromCacheOrWellKnownEndpoint ($ trustAnchorId );
@@ -71,7 +75,8 @@ public function discover(
7175 ksort ($ discoveredEntities );
7276
7377 $ this ->entityCollectionStore ->store ($ trustAnchorId , $ discoveredEntities , $ ttl );
74- $ this ->entityCollectionStore ->storeLastUpdated ($ trustAnchorId , time (), $ ttl );
78+ $ lastUpdated = time ();
79+ $ this ->entityCollectionStore ->storeLastUpdated ($ trustAnchorId , $ lastUpdated , $ ttl );
7580
7681 $ this ->logger ?->info('Federation discovery completed. ' , [
7782 'trustAnchorId ' => $ trustAnchorId ,
@@ -84,7 +89,7 @@ public function discover(
8489 ]);
8590 }
8691
87- return $ this ->entityCollectionFactory ->build ($ discoveredEntities );
92+ return $ this ->entityCollectionFactory ->build ($ discoveredEntities, $ lastUpdated );
8893 }
8994
9095
0 commit comments