Skip to content

Add email unsubscriptions#1843

Merged
ssalinas merged 4 commits into
masterfrom
email-unsub
Sep 10, 2018
Merged

Add email unsubscriptions#1843
ssalinas merged 4 commits into
masterfrom
email-unsub

Conversation

@pschoenfelder

Copy link
Copy Markdown
Contributor

No description provided.

@pschoenfelder pschoenfelder requested a review from ssalinas August 29, 2018 16:41
@ssalinas

Copy link
Copy Markdown
Contributor

storage/api portions look fine here. Only potential thing I see is that, since Singularity sends a lot of emails, we will make quite a few getChildren calls fetching that list. Can we maybe cache it for some amount of time? Even caching for 5 minutes or so would save a ton of calls


public void addToBlacklist(String email) {
create(getEmailPath(email));
cache.invalidate(BLACKLIST_ROOT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

last note here... depending what singularity service instance is hit this may or may not do any good. If the leader is hit with the api call, then it will be effective immediately. If a non-leader instance is hit, the leader will still be waiting until its cache expires. If we want this to be 100% consistent on the leader, we'd want to add the maybeProxyToLeader pattern we use in other resources to the NotificationsResource.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. But how does hitting the leader ensure synchronization across all instances if each has it's own cache? Wouldn't we need to invalidate the cache on every single instance?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It doesn't ensure synchronization everywhere, but it ensures that the one actually doing the email sending is up to date

@ssalinas

Copy link
Copy Markdown
Contributor

🚢

@ssalinas ssalinas merged commit 1c2ec0c into master Sep 10, 2018
@ssalinas ssalinas deleted the email-unsub branch September 10, 2018 19:34
@ssalinas ssalinas added this to the 0.21.0 milestone Sep 26, 2018
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