gitcoinco / grants-stack-api

GNU Affero General Public License v3.0
13 stars 2 forks source link

Incremental updates #35

Open vacekj opened 1 year ago

vacekj commented 1 year ago

Store a last-updated-block number in a db row, or fetch it from the votes table (latest vote), once that's over a debounce limit (5mins), trigger an update using r_query_qf_votes src/utils.rs:220

Do this check as part of an often-called endpoint, still execute the normal endpoint logic either way. Don't do anything if not ripe for update yet - only one db read per query.