mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-03 14:42:47 +00:00
Transactional isolation for /sync
(#2745)
This should transactional snapshot isolation for `/sync` etc requests. For now we don't use repeatable read due to some odd test failures with invites.
This commit is contained in:
parent
8a82f10046
commit
6348486a13
37 changed files with 1759 additions and 1527 deletions
|
@ -49,6 +49,20 @@ func NewDatabase(base *base.BaseDendrite, dbProperties *config.DatabaseOptions)
|
|||
return &d, nil
|
||||
}
|
||||
|
||||
func (d *SyncServerDatasource) NewDatabaseSnapshot(ctx context.Context) (*shared.DatabaseTransaction, error) {
|
||||
return &shared.DatabaseTransaction{
|
||||
Database: &d.Database,
|
||||
// not setting a transaction because SQLite doesn't support it
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *SyncServerDatasource) NewDatabaseTransaction(ctx context.Context) (*shared.DatabaseTransaction, error) {
|
||||
return &shared.DatabaseTransaction{
|
||||
Database: &d.Database,
|
||||
// not setting a transaction because SQLite doesn't support it
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (d *SyncServerDatasource) prepare(ctx context.Context) (err error) {
|
||||
if err = d.streamID.Prepare(d.db); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue