+2
-2
cmd/relay/relay/host.go
+2
-2
cmd/relay/relay/host.go
···
38
defer span.End()
39
40
var host models.Host
41
-
if err := r.db.WithContext(ctx).Find(&host, hostID).Error; err != nil {
42
if errors.Is(err, gorm.ErrRecordNotFound) {
43
return nil, ErrHostNotFound
44
}
···
125
//
126
// Note that in some situations this may have partial success.
127
func (r *Relay) PersistHostCursors(ctx context.Context, cursors *[]HostCursor) error {
128
-
tx := r.db.WithContext(ctx).WithContext(ctx).Begin()
129
for _, cur := range *cursors {
130
if cur.LastSeq <= 0 {
131
continue
···
38
defer span.End()
39
40
var host models.Host
41
+
if err := r.db.WithContext(ctx).First(&host, hostID).Error; err != nil {
42
if errors.Is(err, gorm.ErrRecordNotFound) {
43
return nil, ErrHostNotFound
44
}
···
125
//
126
// Note that in some situations this may have partial success.
127
func (r *Relay) PersistHostCursors(ctx context.Context, cursors *[]HostCursor) error {
128
+
tx := r.db.WithContext(ctx).Begin()
129
for _, cur := range *cursors {
130
if cur.LastSeq <= 0 {
131
continue