aboutsummaryrefslogtreecommitdiff
path: root/syncapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-09-01 10:26:02 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2020-09-01 10:26:02 +0100
commitb0d2b39739551a46698222ec62a3c5fb11efd7e5 (patch)
treee845753eaa9733f6a9e402f88b6de38d8db1872a /syncapi
parentf7b2a5866e69749d48aae675ba1613ad2b70fa7c (diff)
Remove unused SyncStreamPosition
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/storage/interface.go2
-rw-r--r--syncapi/storage/shared/syncserver.go29
2 files changed, 0 insertions, 31 deletions
diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go
index a5e13b67..838fd547 100644
--- a/syncapi/storage/interface.go
+++ b/syncapi/storage/interface.go
@@ -104,8 +104,6 @@ type Database interface {
// matches the streamevent.transactionID device then the transaction ID gets
// added to the unsigned section of the output event.
StreamEventsToEvents(device *userapi.Device, in []types.StreamEvent) []gomatrixserverlib.HeaderedEvent
- // SyncStreamPosition returns the latest position in the sync stream. Returns 0 if there are no events yet.
- SyncStreamPosition(ctx context.Context) (types.StreamPosition, error)
// AddSendToDevice increases the EDU position in the cache and returns the stream position.
AddSendToDevice() types.StreamPosition
// SendToDeviceUpdatesForSync returns a list of send-to-device updates. It returns three lists:
diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go
index 401bae33..37793ba2 100644
--- a/syncapi/storage/shared/syncserver.go
+++ b/syncapi/storage/shared/syncserver.go
@@ -133,35 +133,6 @@ func (d *Database) GetStateEventsForRoom(
return
}
-func (d *Database) SyncStreamPosition(ctx context.Context) (types.StreamPosition, error) {
- var maxID int64
- var err error
- err = sqlutil.WithTransaction(d.DB, func(txn *sql.Tx) error {
- maxID, err = d.OutputEvents.SelectMaxEventID(ctx, txn)
- if err != nil {
- return err
- }
- var maxAccountDataID int64
- maxAccountDataID, err = d.AccountData.SelectMaxAccountDataID(ctx, txn)
- if err != nil {
- return err
- }
- if maxAccountDataID > maxID {
- maxID = maxAccountDataID
- }
- var maxInviteID int64
- maxInviteID, err = d.Invites.SelectMaxInviteID(ctx, txn)
- if err != nil {
- return err
- }
- if maxInviteID > maxID {
- maxID = maxInviteID
- }
- return nil
- })
- return types.StreamPosition(maxID), err
-}
-
// AddInviteEvent stores a new invite event for a user.
// If the invite was successfully stored this returns the stream ID it was stored at.
// Returns an error if there was a problem communicating with the database.