EventQueryService caching refresh rate
App Development3 posts63 views1 likesLast activity Sep 2024
JU
Judy_WuOP
Aug 2024In canton ledger api, EventQueryService served both GetEventsByContractIdRequest and GetEventsByContractKeyRequest.
We are wondering if this endpoint can reliably reflect ledger’s state.
Below are the questions we had in mind
- Is this service caching the ledger state?
- If 1 is true, what is the gap in time with the actual ledger state and the cache state?
- is it possible to config the refresh rate of the cache with actual ledger state?
Thanks so much in advance~
SI
simon
Aug 2024The GetEventsByContractIdRequest processing is not cached.
The GetEventsByContractKeyRequest processing may return a cached result for a short time such that the created event is populated but the archive event is not. This can only happen for a short interval between the time when the contract is archived and the processed transaction being observed by the event cache (this will usually be almost immediate).
JU
Judy_Wu
Sep 2024Got it, thanks so much @simon!