Rename handlers and add PrefixHandler for database routing table

- Renamed BatchedDatabaseHandler to DBHandler
- Renamed BatchedPeerHandler to PeerHandler
- Quadrupled DBHandler batch size from 4000 to 16000
- Created new PrefixHandler using same batching strategy to maintain routing table in database
- Removed verbose batch flush logging from all handlers
- Updated app.go to use renamed handlers and register PrefixHandler
- Fixed test configuration to enable batched database writes
This commit is contained in:
2025-07-28 01:37:19 +02:00
parent 3aef3f9a07
commit cea7c3dfd3
8 changed files with 623 additions and 584 deletions

View File

@@ -145,7 +145,6 @@ func (s *Server) handleStatusJSON() http.HandlerFunc {
errChan := make(chan error)
go func() {
s.logger.Debug("Starting database stats query")
dbStats, err := s.db.GetStats()
if err != nil {
s.logger.Debug("Database stats query failed", "error", err)
@@ -153,7 +152,6 @@ func (s *Server) handleStatusJSON() http.HandlerFunc {
return
}
s.logger.Debug("Database stats query completed")
statsChan <- dbStats
}()
@@ -287,7 +285,6 @@ func (s *Server) handleStats() http.HandlerFunc {
errChan := make(chan error)
go func() {
s.logger.Debug("Starting database stats query")
dbStats, err := s.db.GetStats()
if err != nil {
s.logger.Debug("Database stats query failed", "error", err)
@@ -295,7 +292,6 @@ func (s *Server) handleStats() http.HandlerFunc {
return
}
s.logger.Debug("Database stats query completed")
statsChan <- dbStats
}()