add correct backfile

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-06-14 13:41:42 +02:00
commit 28e082f0fc
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
8 changed files with 317 additions and 35 deletions

View file

@ -8,6 +8,7 @@ import (
"git.g3e.fr/H6N/account/internal/auth"
"git.g3e.fr/H6N/account/internal/config"
"git.g3e.fr/H6N/account/internal/handler"
"git.g3e.fr/H6N/account/internal/pipeline"
"git.g3e.fr/H6N/account/internal/snapshot"
"git.g3e.fr/H6N/account/internal/store"
"github.com/jackc/pgx/v5/pgxpool"
@ -43,10 +44,16 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (s *Server) routes() {
st := store.New(s.pool)
horizonDays := 30
var pipelineCfg pipeline.Config
if s.cfg != nil {
horizonDays = s.cfg.SnapshotHorizonDays
pipelineCfg = pipeline.Config{
OpenFIGIKey: s.cfg.OpenFIGIKey,
CoinGeckoKey: s.cfg.CoinGeckoKey,
}
}
eng := snapshot.New(st, s.logger, horizonDays)
pl := pipeline.New(st, pipelineCfg, s.logger)
eng := snapshot.New(st, s.logger, horizonDays).WithBackfiller(pl)
handler.NewInstrumentHandler(st).RegisterRoutes(s.mux)
handler.NewAccountHandler(st).RegisterRoutes(s.mux)