Tweaks to backfill (#964)
parent
895a72b6ee
commit
7b3edf4622
|
@ -93,7 +93,7 @@ func Backfill(
|
||||||
}
|
}
|
||||||
|
|
||||||
var eventJSONs []json.RawMessage
|
var eventJSONs []json.RawMessage
|
||||||
for _, e := range evs {
|
for _, e := range gomatrixserverlib.ReverseTopologicalOrdering(evs) {
|
||||||
eventJSONs = append(eventJSONs, e.JSON())
|
eventJSONs = append(eventJSONs, e.JSON())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ const insertBackwardExtremitySQL = "" +
|
||||||
" ON CONFLICT DO NOTHING"
|
" ON CONFLICT DO NOTHING"
|
||||||
|
|
||||||
const selectBackwardExtremitiesForRoomSQL = "" +
|
const selectBackwardExtremitiesForRoomSQL = "" +
|
||||||
"SELECT event_id FROM syncapi_backward_extremities WHERE room_id = $1"
|
"SELECT DISTINCT event_id FROM syncapi_backward_extremities WHERE room_id = $1"
|
||||||
|
|
||||||
const deleteBackwardExtremitySQL = "" +
|
const deleteBackwardExtremitySQL = "" +
|
||||||
"DELETE FROM syncapi_backward_extremities WHERE room_id = $1 AND prev_event_id = $2"
|
"DELETE FROM syncapi_backward_extremities WHERE room_id = $1 AND prev_event_id = $2"
|
||||||
|
|
|
@ -60,7 +60,7 @@ const insertBackwardExtremitySQL = "" +
|
||||||
" ON CONFLICT (room_id, event_id, prev_event_id) DO NOTHING"
|
" ON CONFLICT (room_id, event_id, prev_event_id) DO NOTHING"
|
||||||
|
|
||||||
const selectBackwardExtremitiesForRoomSQL = "" +
|
const selectBackwardExtremitiesForRoomSQL = "" +
|
||||||
"SELECT event_id FROM syncapi_backward_extremities WHERE room_id = $1"
|
"SELECT DISTINCT event_id FROM syncapi_backward_extremities WHERE room_id = $1"
|
||||||
|
|
||||||
const deleteBackwardExtremitySQL = "" +
|
const deleteBackwardExtremitySQL = "" +
|
||||||
"DELETE FROM syncapi_backward_extremities WHERE room_id = $1 AND prev_event_id = $2"
|
"DELETE FROM syncapi_backward_extremities WHERE room_id = $1 AND prev_event_id = $2"
|
||||||
|
|
Loading…
Reference in New Issue