Skip to content

Commit 0344578

Browse files
committed
refactor: remove currency registry from server initialization in main.go and clean up server options
Signed-off-by: Ghislain Cheng <ghislain.cheng@zama.ai>
1 parent ef9cc5e commit 0344578

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

cmd/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ func main() {
124124

125125
// Bootstrap Server with both registries
126126
server := httpfiber.NewServer(config,
127-
httpfiber.WithRegistry(promRegistry),
128-
httpfiber.WithCurrencyRegistry(currencyRegistry))
127+
httpfiber.WithRegistry(promRegistry))
129128

130129
signalChain := make(chan os.Signal, 1)
131130
signal.Notify(signalChain, os.Interrupt)

pkg/server/http/server.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ import (
1212
"github.com/prometheus/client_golang/prometheus"
1313
"github.com/prometheus/client_golang/prometheus/promhttp"
1414
"github.com/zama-ai/blockchain-wallet-exporter/pkg/config"
15-
"github.com/zama-ai/blockchain-wallet-exporter/pkg/currency"
1615
"github.com/zama-ai/blockchain-wallet-exporter/pkg/logger"
1716

1817
"go.uber.org/zap"
1918
)
2019

2120
type Server struct {
22-
app *fiber.App
23-
cfg *config.Schema
24-
currencyRegistry *currency.Registry
21+
app *fiber.App
22+
cfg *config.Schema
2523

2624
// Max concurrent requests for the collector
2725
MaxConccurentRequests int
@@ -54,12 +52,6 @@ func WithRegistry(registry *prometheus.Registry) Option {
5452
}
5553
}
5654

57-
func WithCurrencyRegistry(registry *currency.Registry) Option {
58-
return func(s *Server) {
59-
s.currencyRegistry = registry
60-
}
61-
}
62-
6355
func (s *Server) Run() error {
6456
if s.cfg.Global.Environment == "production" {
6557
// parse log level

0 commit comments

Comments
 (0)