aboutsummaryrefslogtreecommitdiff
path: root/syncapi/consumers/clientapi.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-03-03 12:09:16 +0000
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-03-03 12:09:16 +0000
commit6ed8cf0e07322fd78c41b22fc94c40dfa9c6d47a (patch)
tree4c1a8efa375403551bfd0283756eec5b9bcc777e /syncapi/consumers/clientapi.go
parentbcc27e9e1884add0ba272eaf2bb4c45a03f76e85 (diff)
Handle `ErrNoRows` when sending read updates
Diffstat (limited to 'syncapi/consumers/clientapi.go')
-rw-r--r--syncapi/consumers/clientapi.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/syncapi/consumers/clientapi.go b/syncapi/consumers/clientapi.go
index f01afce6..fcb7b5b1 100644
--- a/syncapi/consumers/clientapi.go
+++ b/syncapi/consumers/clientapi.go
@@ -16,6 +16,7 @@ package consumers
import (
"context"
+ "database/sql"
"encoding/json"
"fmt"
@@ -138,12 +139,12 @@ func (s *OutputClientDataConsumer) sendReadUpdate(ctx context.Context, userID st
var readPos types.StreamPosition
var fullyReadPos types.StreamPosition
if output.ReadMarker.Read != "" {
- if _, readPos, err = s.db.PositionInTopology(ctx, output.ReadMarker.Read); err != nil {
+ if _, readPos, err = s.db.PositionInTopology(ctx, output.ReadMarker.Read); err != nil && err != sql.ErrNoRows {
return fmt.Errorf("s.db.PositionInTopology (Read): %w", err)
}
}
if output.ReadMarker.FullyRead != "" {
- if _, fullyReadPos, err = s.db.PositionInTopology(ctx, output.ReadMarker.FullyRead); err != nil {
+ if _, fullyReadPos, err = s.db.PositionInTopology(ctx, output.ReadMarker.FullyRead); err != nil && err != sql.ErrNoRows {
return fmt.Errorf("s.db.PositionInTopology (FullyRead): %w", err)
}
}