diff options
author | Kegsay <kegan@matrix.org> | 2020-09-07 14:47:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 14:47:59 +0100 |
commit | c992f4f1f44b0e43e52010b10bc0a82ddf26848d (patch) | |
tree | 5468390c58377a69f9ae30b6511667e011256e8a /syncapi | |
parent | 8589f8373e627f9229e729186ab800d3116c12da (diff) |
Remove current state server (#1405)
* Remove current state server
Closes #1365 #1272 #1357
* Remove current state server from scripts/docs
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/consumers/keychange.go | 4 | ||||
-rw-r--r-- | syncapi/sync/requestpool.go | 6 | ||||
-rw-r--r-- | syncapi/syncapi.go | 6 |
3 files changed, 4 insertions, 12 deletions
diff --git a/syncapi/consumers/keychange.go b/syncapi/consumers/keychange.go index 5b50bac2..200ac85c 100644 --- a/syncapi/consumers/keychange.go +++ b/syncapi/consumers/keychange.go @@ -20,7 +20,6 @@ import ( "sync" "github.com/Shopify/sarama" - currentstateAPI "github.com/matrix-org/dendrite/currentstateserver/api" "github.com/matrix-org/dendrite/internal" "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" @@ -38,7 +37,6 @@ type OutputKeyChangeEventConsumer struct { db storage.Database serverName gomatrixserverlib.ServerName // our server name rsAPI roomserverAPI.RoomserverInternalAPI - stateAPI currentstateAPI.CurrentStateInternalAPI keyAPI api.KeyInternalAPI partitionToOffset map[int32]int64 partitionToOffsetMu sync.Mutex @@ -54,7 +52,6 @@ func NewOutputKeyChangeEventConsumer( n *syncapi.Notifier, keyAPI api.KeyInternalAPI, rsAPI roomserverAPI.RoomserverInternalAPI, - stateAPI currentstateAPI.CurrentStateInternalAPI, store storage.Database, ) *OutputKeyChangeEventConsumer { @@ -71,7 +68,6 @@ func NewOutputKeyChangeEventConsumer( serverName: serverName, keyAPI: keyAPI, rsAPI: rsAPI, - stateAPI: stateAPI, partitionToOffset: make(map[int32]int64), partitionToOffsetMu: sync.Mutex{}, notifier: n, diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go index 319a8149..aaaf9491 100644 --- a/syncapi/sync/requestpool.go +++ b/syncapi/sync/requestpool.go @@ -23,7 +23,6 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - currentstateAPI "github.com/matrix-org/dendrite/currentstateserver/api" keyapi "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/syncapi/internal" @@ -42,15 +41,14 @@ type RequestPool struct { notifier *Notifier keyAPI keyapi.KeyInternalAPI rsAPI roomserverAPI.RoomserverInternalAPI - stateAPI currentstateAPI.CurrentStateInternalAPI } // NewRequestPool makes a new RequestPool func NewRequestPool( db storage.Database, n *Notifier, userAPI userapi.UserInternalAPI, keyAPI keyapi.KeyInternalAPI, - rsAPI roomserverAPI.RoomserverInternalAPI, stateAPI currentstateAPI.CurrentStateInternalAPI, + rsAPI roomserverAPI.RoomserverInternalAPI, ) *RequestPool { - return &RequestPool{db, userAPI, n, keyAPI, rsAPI, stateAPI} + return &RequestPool{db, userAPI, n, keyAPI, rsAPI} } // OnIncomingSyncRequest is called when a client makes a /sync request. This function MUST be diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go index 634bd1ee..c77c5541 100644 --- a/syncapi/syncapi.go +++ b/syncapi/syncapi.go @@ -21,7 +21,6 @@ import ( "github.com/gorilla/mux" "github.com/sirupsen/logrus" - currentstateapi "github.com/matrix-org/dendrite/currentstateserver/api" "github.com/matrix-org/dendrite/internal/config" keyapi "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/roomserver/api" @@ -42,7 +41,6 @@ func AddPublicRoutes( userAPI userapi.UserInternalAPI, rsAPI api.RoomserverInternalAPI, keyAPI keyapi.KeyInternalAPI, - currentStateAPI currentstateapi.CurrentStateInternalAPI, federation *gomatrixserverlib.FederationClient, cfg *config.SyncAPI, ) { @@ -62,11 +60,11 @@ func AddPublicRoutes( logrus.WithError(err).Panicf("failed to start notifier") } - requestPool := sync.NewRequestPool(syncDB, notifier, userAPI, keyAPI, rsAPI, currentStateAPI) + requestPool := sync.NewRequestPool(syncDB, notifier, userAPI, keyAPI, rsAPI) keyChangeConsumer := consumers.NewOutputKeyChangeEventConsumer( cfg.Matrix.ServerName, string(cfg.Matrix.Kafka.TopicFor(config.TopicOutputKeyChangeEvent)), - consumer, notifier, keyAPI, rsAPI, currentStateAPI, syncDB, + consumer, notifier, keyAPI, rsAPI, syncDB, ) if err = keyChangeConsumer.Start(); err != nil { logrus.WithError(err).Panicf("failed to start key change consumer") |