Open rowanseymour opened 2 weeks ago
Maybe tho... this belongs in courier since 1) we can pop old messages out of redis without querying against the db 2) courier has the functionality for batch updates of message statuses.
Mailroom might still be responsible for Android messages.
we check the created on date is not older than a week ago, and to avoid breaking the resend feature we also check the nextAttempt field is not set or is also older than a week ago?
I don't think we have to worry about resending. If a message is in a courier queue, then it should be status Q
or E
and users can't request to resend those.. and it doesn't matter if next_attempt
is set.. if it's 7 days old we fail it.
I think the first time a message is queued next_attempt
is not set (set to epoch time) so that would skip all those messages so that is why I think we need to use a combination of created_on
and next_attempt
logic
Ah I think we should find messages that are too old by looking at their score timestamp in the channel queue in Redis.. we wouldn't be querying from the database.
And remove them from the redis queues. Would replace
fail_old_messages
in RP that doesn't do that.