fedsender: tolerate dupe membership events (#1824)
* fedsender: tolerate dupe membership events Previously if the fedsender got a duplicate membership event it would cause the entire process to crash. Now it doesn't. This masks an issue with the roomserver where it can emit duplicate membership events. * Update joined_hosts_table.gomain
parent
653e30619c
commit
656d11ec90
|
@ -48,7 +48,7 @@ CREATE INDEX IF NOT EXISTS federatonsender_joined_hosts_room_id_idx
|
||||||
|
|
||||||
const insertJoinedHostsSQL = "" +
|
const insertJoinedHostsSQL = "" +
|
||||||
"INSERT INTO federationsender_joined_hosts (room_id, event_id, server_name)" +
|
"INSERT INTO federationsender_joined_hosts (room_id, event_id, server_name)" +
|
||||||
" VALUES ($1, $2, $3)"
|
" VALUES ($1, $2, $3) ON CONFLICT DO NOTHING"
|
||||||
|
|
||||||
const deleteJoinedHostsSQL = "" +
|
const deleteJoinedHostsSQL = "" +
|
||||||
"DELETE FROM federationsender_joined_hosts WHERE event_id = ANY($1)"
|
"DELETE FROM federationsender_joined_hosts WHERE event_id = ANY($1)"
|
||||||
|
|
|
@ -47,7 +47,7 @@ CREATE INDEX IF NOT EXISTS federatonsender_joined_hosts_room_id_idx
|
||||||
`
|
`
|
||||||
|
|
||||||
const insertJoinedHostsSQL = "" +
|
const insertJoinedHostsSQL = "" +
|
||||||
"INSERT INTO federationsender_joined_hosts (room_id, event_id, server_name)" +
|
"INSERT OR IGNORE INTO federationsender_joined_hosts (room_id, event_id, server_name)" +
|
||||||
" VALUES ($1, $2, $3)"
|
" VALUES ($1, $2, $3)"
|
||||||
|
|
||||||
const deleteJoinedHostsSQL = "" +
|
const deleteJoinedHostsSQL = "" +
|
||||||
|
|
Loading…
Reference in New Issue