deliver Delete activities to all known instances #198
1 changed files with 2 additions and 2 deletions
|
@ -103,12 +103,12 @@ export default class DeliverManager {
|
|||
// deliver to all of known network
|
||||
const sharedInboxes = await Users.createQueryBuilder('users')
|
||||
Johann150 marked this conversation as resolved
|
||||
.select('users.sharedInbox', 'sharedInbox')
|
||||
// so we don't have to make our inboxes Set work as hard
|
||||
.distinct(true)
|
||||
// can't deliver to unknown shared inbox
|
||||
.where('users.sharedInbox IS NOT NULL')
|
||||
// don't deliver to ourselves
|
||||
.andWhere('users.host IS NOT NULL')
|
||||
// so we don't have to make our inboxes Set work as hard
|
||||
.groupBy('users.sharedInbox')
|
||||
.getRawMany();
|
||||
|
||||
for (const inbox of sharedInboxes) {
|
||||
|
|
Loading…
Reference in a new issue
SELECT DISTINCT
would be preferable. Overall, it seems that target inboxes are not deduplicated.That is what the
groupBy
in line 111 was meant for. I didn't know, but just checked and there is.distinct(true)
available for query builders to achieveSELECT DISTINCT
. I'm not sure if it makes a difference toGROUP BY
.The overall deduplication is achieved because
inboxes
is aSet
and not an array.Best way to check that would be via Postgres
EXPLAIN ANALYZE
, I believe.I ran it myself but I also had a look at this Stackoverflow answer.
result of running
EXPLAIN ANALYZE
. tl;dr the query plans are identicalFrom the Stackoverflow answer:
Fun thing just happend, postgres 15 came out and...
Would be nice to see if we're affected.