Add context to the syncapi database (#234)
This commit is contained in:
parent
238646ee3c
commit
856bc5b52e
10 changed files with 182 additions and 84 deletions
|
|
@ -15,6 +15,7 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
|
|
@ -131,8 +132,8 @@ func (n *Notifier) WaitForEvents(req syncRequest) types.StreamPosition {
|
|||
}
|
||||
|
||||
// Load the membership states required to notify users correctly.
|
||||
func (n *Notifier) Load(db *storage.SyncServerDatabase) error {
|
||||
roomToUsers, err := db.AllJoinedUsersInRooms()
|
||||
func (n *Notifier) Load(ctx context.Context, db *storage.SyncServerDatabase) error {
|
||||
roomToUsers, err := db.AllJoinedUsersInRooms(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue