@@ -135,7 +135,7 @@ pub trait Cache {
135
135
ids : Vec < FeedId > ,
136
136
request_time : RequestTime ,
137
137
filter : MessageStateFilter ,
138
- ) -> Result < Vec < MessageState > > ;
138
+ ) -> Result < Vec < MessageState > > ;
139
139
async fn is_cache_ready ( & self ) -> bool ;
140
140
}
141
141
@@ -276,18 +276,18 @@ where
276
276
Ok ( cache. get ( & slot) . cloned ( ) )
277
277
}
278
278
279
- /// Checks if the cache contains sufficient data to serve requests.
280
- /// Specifically, TWAP requests -- to serve a TWAP of X seconds, there
279
+ /// Checks if the cache contains sufficient data to serve requests.
280
+ /// Specifically, TWAP requests -- to serve a TWAP of X seconds, there
281
281
/// needs to be X seconds of data in the cache. We need to serve TWAPs
282
- /// from the cache since TwapMessages only exist in Hermes at the moment,
282
+ /// from the cache since TwapMessages only exist in Hermes at the moment,
283
283
/// not Benchmarks.
284
- ///
285
- /// The cache is considered ready when it is at or near its maximum capacity.
284
+ ///
285
+ /// The cache is considered ready when it is at or near its maximum slot capacity.
286
286
async fn is_cache_ready ( & self ) -> bool {
287
- let message_cache = self . into ( ) . message_cache . read ( ) . await ;
288
- let cache_size = self . into ( ) . cache_size as usize ;
289
-
290
- message_cache. len ( ) >= ( cache_size * 9 / 10 )
287
+ let message_cache = self . into ( ) . accumulator_messages_cache . read ( ) . await ;
288
+ let max_cache_size = self . into ( ) . cache_size as usize ;
289
+
290
+ message_cache. len ( ) >= ( max_cache_size * 9 / 10 )
291
291
}
292
292
}
293
293
0 commit comments