WIP: dynamic spam list - #757
Open
janl wants to merge 1 commit into
Open
Conversation
janl
force-pushed
the
feat/dynamic-spam-list
branch
from
May 11, 2018 13:16
6a8ab9b to
24b0658
Compare
rmehner
reviewed
May 11, 2018
| const { gk } = dbs() | ||
| return gk.get('spam') | ||
| .then(spamDoc => spamDoc.spam) | ||
| .catch(() => {}) |
Contributor
There was a problem hiding this comment.
💡 What do you think about returning an empty array when either the database connect did not work or the doc could not be found? That way, you don't interrupt the program for something that is not a critical error condition.
(Might be better to do it on the call side tho)
Contributor
There was a problem hiding this comment.
(sorry for this drive by thing, after a week of staying in bed with a cold I just started to work off my inbox and this was on top :D)
Contributor
Author
There was a problem hiding this comment.
or rather, make it so that if an error occurs, we don’t overwrite things in index.js, so at worst we block the old spammer list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of hardcoding a list of spammer ids and names, we read them from the database.
This allows faster response times when we don’t have to wait for a full stage/prod deploy cycle.
The list of spammers is updated every minute, to reduce db load.
WIP because we still need to figure out how to bootstrap this cleanly, e.g. how to get the doc set up automatically.