Add context to the syncapi database (#234)

This commit is contained in:
Mark Haines 2017-09-18 16:52:22 +01:00 committed by GitHub
parent 238646ee3c
commit 856bc5b52e
10 changed files with 182 additions and 84 deletions

View file

@ -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
}