diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-07-20 16:55:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 16:55:20 +0100 |
commit | 11a39fe3b5afeadafd2c842951462d9332ebecca (patch) | |
tree | 88c3601666ecd6e891c64875f29e1f8ce22eac34 /syncapi | |
parent | f3c482b078c2fbb6d6d7a41be44c2e841d70d8b8 (diff) |
Deduplicate FS database, EDU persistence table (#1207)
* Deduplicate FS database, add some EDU persistence groundwork
* Extend TransactionWriter to use optional existing transaction, use that for FS SQLite database writes
* Fix build due to bad keyserver import
* Working EDU persistence
* gocyclo, unsurprisingly
* Remove unused
* Update copyright notices
Diffstat (limited to 'syncapi')
-rw-r--r-- | syncapi/storage/shared/syncserver.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 38b503cd..32079291 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -1114,7 +1114,7 @@ func (d *Database) StoreNewSendForDeviceMessage( } // Delegate the database write task to the SendToDeviceWriter. It'll guarantee // that we don't lock the table for writes in more than one place. - err = d.SendToDeviceWriter.Do(d.DB, func(txn *sql.Tx) error { + err = d.SendToDeviceWriter.Do(d.DB, nil, func(txn *sql.Tx) error { return d.AddSendToDeviceEvent( ctx, txn, userID, deviceID, string(j), ) @@ -1179,7 +1179,7 @@ func (d *Database) CleanSendToDeviceUpdates( // If we need to write to the database then we'll ask the SendToDeviceWriter to // do that for us. It'll guarantee that we don't lock the table for writes in // more than one place. - err = d.SendToDeviceWriter.Do(d.DB, func(txn *sql.Tx) error { + err = d.SendToDeviceWriter.Do(d.DB, nil, func(txn *sql.Tx) error { // Delete any send-to-device messages marked for deletion. if e := d.SendToDevice.DeleteSendToDeviceMessages(ctx, txn, toDelete); e != nil { return fmt.Errorf("d.SendToDevice.DeleteSendToDeviceMessages: %w", e) |