mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-22 05:23:09 -06:00
Various typos and whitespace cleanup
This commit is contained in:
parent
4626f6c9d8
commit
75bc8ab826
|
|
@ -24,7 +24,7 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PerformRelayServerSync implements api.FederationInternalAPI
|
// PerformRelayServerSync implements api.RelayInternalAPI
|
||||||
func (r *RelayInternalAPI) PerformRelayServerSync(
|
func (r *RelayInternalAPI) PerformRelayServerSync(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
request *api.PerformRelayServerSyncRequest,
|
request *api.PerformRelayServerSyncRequest,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ func TestRelayAPIClientNil(t *testing.T) {
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRelayAPIClientPerormSync(t *testing.T) {
|
func TestRelayAPIClientPerformSync(t *testing.T) {
|
||||||
// Start a local HTTP server
|
// Start a local HTTP server
|
||||||
server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
|
||||||
assert.Equal(t, "/api"+RelayAPIPerformRelayServerSyncPath, req.URL.String())
|
assert.Equal(t, "/api"+RelayAPIPerformRelayServerSyncPath, req.URL.String())
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,12 @@ type Database struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Database) StoreTransaction(
|
func (d *Database) StoreTransaction(
|
||||||
ctx context.Context, txn gomatrixserverlib.Transaction,
|
ctx context.Context, transaction gomatrixserverlib.Transaction,
|
||||||
) (*shared.Receipt, error) {
|
) (*shared.Receipt, error) {
|
||||||
var err error
|
var err error
|
||||||
json, err := json.Marshal(txn)
|
json, err := json.Marshal(transaction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("d.JSONUnmarshall: %w", err)
|
return nil, fmt.Errorf("failed to marshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var nid int64
|
var nid int64
|
||||||
|
|
@ -83,7 +83,6 @@ func (d *Database) CleanTransactions(
|
||||||
userID gomatrixserverlib.UserID,
|
userID gomatrixserverlib.UserID,
|
||||||
receipts []*shared.Receipt,
|
receipts []*shared.Receipt,
|
||||||
) error {
|
) error {
|
||||||
println(len(receipts))
|
|
||||||
nids := make([]int64, len(receipts))
|
nids := make([]int64, len(receipts))
|
||||||
for i, receipt := range receipts {
|
for i, receipt := range receipts {
|
||||||
nids[i] = receipt.GetNID()
|
nids[i] = receipt.GetNID()
|
||||||
|
|
@ -132,7 +131,7 @@ func (d *Database) GetTransaction(
|
||||||
transaction := &gomatrixserverlib.Transaction{}
|
transaction := &gomatrixserverlib.Transaction{}
|
||||||
err = json.Unmarshal(txns[nids[0]], transaction)
|
err = json.Unmarshal(txns[nids[0]], transaction)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("Unmarshall transaction: %w", err)
|
return nil, nil, fmt.Errorf("Unmarshal transaction: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
receipt := shared.NewReceipt(nids[0])
|
receipt := shared.NewReceipt(nids[0])
|
||||||
|
|
|
||||||
|
|
@ -218,7 +218,7 @@ relay_api:
|
||||||
connection_string: file:relayapi.db
|
connection_string: file:relayapi.db
|
||||||
mscs:
|
mscs:
|
||||||
database:
|
database:
|
||||||
connection_string: file:federationapi.db
|
connection_string: file:mscs.db
|
||||||
tracing:
|
tracing:
|
||||||
enabled: false
|
enabled: false
|
||||||
jaeger:
|
jaeger:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue