aboutsummaryrefslogtreecommitdiff
path: root/federationapi/queue/destinationqueue.go
diff options
context:
space:
mode:
authorkegsay <kegan@matrix.org>2023-04-19 15:50:33 +0100
committerGitHub <noreply@github.com>2023-04-19 15:50:33 +0100
commit72285b2659a31ebd52c91799c17105d81d996f40 (patch)
tree1855395f5efdc3ea6051dd502882bf62aaa57e7c /federationapi/queue/destinationqueue.go
parent9fa39263c0a4a8d349c8715f6ba30cae30b1b73a (diff)
refactor: update GMSL (#3058)
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
Diffstat (limited to 'federationapi/queue/destinationqueue.go')
-rw-r--r--federationapi/queue/destinationqueue.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/federationapi/queue/destinationqueue.go b/federationapi/queue/destinationqueue.go
index a4542c49..c136fe75 100644
--- a/federationapi/queue/destinationqueue.go
+++ b/federationapi/queue/destinationqueue.go
@@ -24,6 +24,7 @@ import (
"github.com/matrix-org/gomatrix"
"github.com/matrix-org/gomatrixserverlib"
"github.com/matrix-org/gomatrixserverlib/fclient"
+ "github.com/matrix-org/gomatrixserverlib/spec"
"github.com/sirupsen/logrus"
"go.uber.org/atomic"
@@ -51,11 +52,11 @@ type destinationQueue struct {
queues *OutgoingQueues
db storage.Database
process *process.ProcessContext
- signing map[gomatrixserverlib.ServerName]*fclient.SigningIdentity
+ signing map[spec.ServerName]*fclient.SigningIdentity
rsAPI api.FederationRoomserverAPI
client fedapi.FederationClient // federation client
- origin gomatrixserverlib.ServerName // origin of requests
- destination gomatrixserverlib.ServerName // destination of requests
+ origin spec.ServerName // origin of requests
+ destination spec.ServerName // destination of requests
running atomic.Bool // is the queue worker running?
backingOff atomic.Bool // true if we're backing off
overflowed atomic.Bool // the queues exceed maxPDUsInMemory/maxEDUsInMemory, so we should consult the database for more
@@ -426,7 +427,7 @@ func (oq *destinationQueue) nextTransaction(
relaySuccess := false
logrus.Infof("Sending %q to relay servers: %v", t.TransactionID, relayServers)
// TODO : how to pass through actual userID here?!?!?!?!
- userID, userErr := gomatrixserverlib.NewUserID("@user:"+string(oq.destination), false)
+ userID, userErr := spec.NewUserID("@user:"+string(oq.destination), false)
if userErr != nil {
return userErr, sendMethod
}
@@ -507,7 +508,7 @@ func (oq *destinationQueue) createTransaction(
// it so that we retry with the same transaction ID.
oq.transactionIDMutex.Lock()
if oq.transactionID == "" {
- now := gomatrixserverlib.AsTimestamp(time.Now())
+ now := spec.AsTimestamp(time.Now())
oq.transactionID = gomatrixserverlib.TransactionID(fmt.Sprintf("%d-%d", now, oq.statistics.SuccessCount()))
}
oq.transactionIDMutex.Unlock()
@@ -518,7 +519,7 @@ func (oq *destinationQueue) createTransaction(
}
t.Origin = oq.origin
t.Destination = oq.destination
- t.OriginServerTS = gomatrixserverlib.AsTimestamp(time.Now())
+ t.OriginServerTS = spec.AsTimestamp(time.Now())
t.TransactionID = oq.transactionID
var pduReceipts []*receipt.Receipt