diff --git a/lib/rep/http-handler.go b/lib/rep/http-handler.go index 05cd424..f1721a9 100644 --- a/lib/rep/http-handler.go +++ b/lib/rep/http-handler.go @@ -12,12 +12,6 @@ const ( pathStreamWAL = "stream-wal" ) -func (rep *Replicator) RegisterHandlers(mux *http.ServeMux, rootPath string) { - mux.HandleFunc(path.Join(rootPath, pathGetInfo), rep.handleGetInfo) - mux.HandleFunc(path.Join(rootPath, pathSendState), rep.handleSendState) - mux.HandleFunc(path.Join(rootPath, pathStreamWAL), rep.handleStreamWAL) -} - // TODO: Remove this! func (rep *Replicator) Handle(w http.ResponseWriter, r *http.Request) { // We'll handle two types of requests: HTTP GET requests for JSON, or diff --git a/mdb/db.go b/mdb/db.go index b290fe9..7e4f5bb 100644 --- a/mdb/db.go +++ b/mdb/db.go @@ -73,6 +73,10 @@ type Database struct { } func New(conf Config) *Database { + if conf.NetTimeout <= 0 { + conf.NetTimeout = time.Minute + } + if conf.MaxConcurrentUpdates <= 0 { conf.MaxConcurrentUpdates = 32 } @@ -183,7 +187,3 @@ func (db *Database) addCollection(id uint64, c collection, collectionState any) func (db *Database) Handle(w http.ResponseWriter, r *http.Request) { db.rep.Handle(w, r) } - -func (db *Database) RegisterHandlers(mux *http.ServeMux, rootPath string) { - db.rep.RegisterHandlers(mux, rootPath) -}