3 Commits

Author SHA1 Message Date
jholdstock
99dc97d6a3 webapi: Abort requests if web cache not ready.
A new middleware aborts any requests which require the data cache if the
cache is not yet initialized. An explicit error is returned so the admin
will be immediately aware what has gone wrong.

Previously, webpages were rendered and JSON responses were sent with
zero values, and with no indication of anything being wrong. This was
sometimes difficult to notice, and even when noticed the cause was not
immediately apparent.
2023-09-19 17:58:59 +01:00
jholdstock
280dc391be webapi: Keep DB and RPC clients inside cache.
Storing references to the database/dcrd/dcrwallet clients inside the
cache struct means they don't need to be passed in every time the cache
is updated.
2023-09-14 20:43:09 +01:00
jholdstock
7ad309c9aa webapi: Move package to internal. 2023-09-13 09:03:05 +01:00