Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement in updateProfanityJson function #5

Open
Yatanvesh opened this issue Sep 19, 2023 · 0 comments
Open

Improvement in updateProfanityJson function #5

Yatanvesh opened this issue Sep 19, 2023 · 0 comments

Comments

@Yatanvesh
Copy link

I've been using this library in my project and at every start of the application I add some 50 words to be blacklisted, and I noticed that the library will write to the profanity_words json 50 times, that's a lot of time to wait for 50 promises to be fulfilled, sequentially.

I have a suggestion, instead of writing to profanity_words.json every time there is a change, we should keep the user blacklisted/ whitelisted words in memory, which I see is already happening with profanityJson variable. The reason for this is that the users will anyhow have to make the blacklist/whitelist calls at application startup and writing to profanity_words.json is a redundant and expensive operation.

So, my suggestion is to either remove the updateProfanityJson function calls entirely, or have the option for user to configure this behavior. I'm willing to make the changes as well as test them.

What do you think?

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

No branches or pull requests

1 participant