add correct backfile
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
f862abe5a4
commit
28e082f0fc
8 changed files with 317 additions and 35 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue