Skip to content

Conversation

@epoberezkin
Copy link
Member

No description provided.

getAllSndQueuesForDelivery db = map toSndQueue <$> DB.query_ db (sndQueueQuery <> " " <> delivery)
where
delivery = [sql|
JOIN (SELECT DISTINCT conn_id, snd_queue_id FROM snd_message_deliveries WHERE failed = 0) d
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this skip queue altogether for delivery, even if it has some failed delivery? delivery is work item, I'm not sure it's correct to exclude queue here - though maybe it's fine for the context it's used in - highlighting to double check

Copy link
Member Author

@epoberezkin epoberezkin Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would it be excluded? it picks distinct conn_id, snd_queue_id fields for rows where failed = 0.

<$> DB.query_
db
[sql|
SELECT DISTINCT c.user_id, q.host, q.port, COALESCE(q.server_key_hash, s.key_hash)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check SELECT DISTINCT in postgres

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to do what?

@epoberezkin epoberezkin merged commit 9cda203 into master Oct 9, 2025
4 of 6 checks passed
@epoberezkin epoberezkin deleted the ep/subscribe-all branch October 9, 2025 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants