Skip to content

Conversation

@thinkt4nk
Copy link
Contributor

@thinkt4nk thinkt4nk commented Mar 3, 2021

@thinkt4nk thinkt4nk force-pushed the chore/send-messages-failure-retry branch 2 times, most recently from ee19421 to 0ca043c Compare March 3, 2021 15:59
@thinkt4nk thinkt4nk requested a review from jaredlewis March 3, 2021 16:00

# Update the emails as sent
to_send.update(sent=current_time)
Email.objects.filter(id__in=emails_sent_ids).update(sent=current_time)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this scenario we are going to have to save each one of these one at a time inside of the loop. Otherwise you run into a similar situation where if this process gets terminated in the middle of sending 1000 emails and you are on number 900, the next time the process starts you will be sending 900 duplicate emails. Unfortunately its inefficient but I cant think of another alternative that fully solves the problem

def setUp(self):
G(Medium, name='email')

@override_settings(DISABLE_DURABILITY_CHECKING=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can apply this at the class level if you need every method to be overridden

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh shit, I only stubbed out the only test in this class that I need to stay undecorated

@thinkt4nk thinkt4nk force-pushed the chore/send-messages-failure-retry branch from 0ca043c to 5b7b51d Compare March 4, 2021 16:49
@thinkt4nk thinkt4nk force-pushed the chore/send-messages-failure-retry branch from 5b7b51d to 8c573a5 Compare March 4, 2021 18:54
@thinkt4nk thinkt4nk requested a review from jaredlewis March 4, 2021 19:02
@thinkt4nk thinkt4nk merged commit baab7de into ambitioninc:develop Mar 4, 2021
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