mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
If there's no updates, don't insert anything
This commit is contained in:
parent
fcd9b490f9
commit
5028f93f83
@ -122,6 +122,9 @@ func upDeviceListTable(ctx context.Context, tx *sql.Tx) error {
|
|||||||
Bucket: state.BucketSent,
|
Bucket: state.BucketSent,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if len(deviceListRows) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
chunks := sqlutil.Chunkify(5, state.MaxPostgresParameters, state.DeviceListChunker(deviceListRows))
|
chunks := sqlutil.Chunkify(5, state.MaxPostgresParameters, state.DeviceListChunker(deviceListRows))
|
||||||
for _, chunk := range chunks {
|
for _, chunk := range chunks {
|
||||||
var placeholders []string
|
var placeholders []string
|
||||||
@ -143,8 +146,6 @@ func upDeviceListTable(ctx context.Context, tx *sql.Tx) error {
|
|||||||
)
|
)
|
||||||
_, err = tx.ExecContext(ctx, query, vals...)
|
_, err = tx.ExecContext(ctx, query, vals...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(query)
|
|
||||||
fmt.Println(vals...)
|
|
||||||
return fmt.Errorf("failed to bulk insert: %s", err)
|
return fmt.Errorf("failed to bulk insert: %s", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user