Tweak setup contexts

This commit is contained in:
Neil Alexander 2022-09-30 10:23:58 +01:00
parent 6650553402
commit ceb530466f
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
7 changed files with 19 additions and 7 deletions

View file

@ -23,7 +23,7 @@ func (p *AccountDataStreamProvider) Setup(
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForAccountData(context.Background())
id, err := snapshot.MaxStreamPositionForAccountData(ctx)
if err != nil {
panic(err)
}

View file

@ -25,7 +25,7 @@ func (p *InviteStreamProvider) Setup(
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForInvites(context.Background())
id, err := snapshot.MaxStreamPositionForInvites(ctx)
if err != nil {
panic(err)
}

View file

@ -16,7 +16,10 @@ func (p *NotificationDataStreamProvider) Setup(
) {
p.DefaultStreamProvider.Setup(ctx, snapshot)
id, err := snapshot.MaxStreamPositionForNotificationData(context.Background())
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForNotificationData(ctx)
if err != nil {
panic(err)
}

View file

@ -47,7 +47,7 @@ func (p *PDUStreamProvider) Setup(
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForPDUs(context.Background())
id, err := snapshot.MaxStreamPositionForPDUs(ctx)
if err != nil {
panic(err)
}

View file

@ -39,7 +39,10 @@ func (p *PresenceStreamProvider) Setup(
) {
p.DefaultStreamProvider.Setup(ctx, snapshot)
id, err := snapshot.MaxStreamPositionForPresence(context.Background())
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForPresence(ctx)
if err != nil {
panic(err)
}

View file

@ -18,7 +18,10 @@ func (p *ReceiptStreamProvider) Setup(
) {
p.DefaultStreamProvider.Setup(ctx, snapshot)
id, err := snapshot.MaxStreamPositionForReceipts(context.Background())
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForReceipts(ctx)
if err != nil {
panic(err)
}

View file

@ -16,7 +16,10 @@ func (p *SendToDeviceStreamProvider) Setup(
) {
p.DefaultStreamProvider.Setup(ctx, snapshot)
id, err := snapshot.MaxStreamPositionForSendToDeviceMessages(context.Background())
p.latestMutex.Lock()
defer p.latestMutex.Unlock()
id, err := snapshot.MaxStreamPositionForSendToDeviceMessages(ctx)
if err != nil {
panic(err)
}