Exclude duplicated votes #62

Closed
d1msdale wants to merge 1 commit from issue-61_duplicated_votes into master
d1msdale commented 2024-06-07 08:52:35 +00:00 (Migrated from github.com)

Exclude semaphore, like potential bottleneck, added use of a mongo addToSet instead of a push

Exclude semaphore, like potential bottleneck, added use of a mongo addToSet instead of a push
d1msdale commented 2024-06-07 09:13:19 +00:00 (Migrated from github.com)

@backmeupplz Let me explain what I did here. Point about addToSet we discussed in issue.
Logic with semaphore was removed because in current implementation it doesn't work as expected- for each processed request will create new semaphore, but for correct work- should be only one object. Like a fix - we can create one semaphore object outside of function scope. But in his case we will have bottleneck, because all requests will process one by one, which means that response time will be significantly longer. That's why semaphore was removed and rewrite push to addToSet.
PR temporary in draft because we want to test solution.

@backmeupplz Let me explain what I did here. Point about addToSet we discussed in issue. Logic with semaphore was removed because in current implementation it doesn't work as expected- for each processed request will create new semaphore, but for correct work- should be only one object. Like a fix - we can create one semaphore object outside of function scope. But in his case we will have bottleneck, because all requests will process one by one, which means that response time will be significantly longer. That's why semaphore was removed and rewrite push to addToSet. PR temporary in draft because we want to test solution.

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/banofbot!62
No description provided.