Skip to content

Commit

Permalink
merging PR Chaosthebot#523: HOTFIX - vote spam
Browse files Browse the repository at this point in the history
Chaosthebot#523: HOTFIX - vote spam

Description:
This is a hotfix to help stop the vote spam we are seeing. Here's how it works.

1. A command is identified and ran
2. The command is then put into the InactiveCommands table to signify it ran

The previous problem was that when identifying new commands, we didn't check if it was already in the inactive commands list.

What does this PR solve? Well it won't re-add commands to the db to be run. HOWEVER it won't solve the problem if there is an issue removing commands from the ActiveCommand table.

Either way, this check needs to be in.

Also, my apologies for the goof. I thought I had tested pretty well but something must have slipped through the cracks.

:white_check_mark: PR passed with a vote of 11 for and 0 against, a weighted total of 10.5 and a threshold of 6.2, and a current meritocracy review.

Vote record:
@Ajedi32: 1
@Leigende: 1
@Reuh: 1
@Smittyvb: 1
@Swizz: 1
@TimvdLippe: 1
@andrewda: 1
@paris-ci: 1
@qgustavor: 1
@rhengles: 1
@rudehn: 1
  • Loading branch information
rudehn authored and chaosbot committed Jun 5, 2017
1 parent a42223e commit f2a2130
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cron/poll_read_issue_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ def poll_read_issue_comments(api):
# Get info and store in db
# Do a check to make sure comment_id isn't a command that already ran
if is_command(issue_comment["comment_text"]):
insert_or_update(api, issue_comment)
_id = issue_comment["global_comment_id"]
# HOTFIX to not re-add command if it was already ran.
try:
InactiveIssueCommands.get(comment=_id)
except InactiveIssueCommands.DoesNotExist:
insert_or_update(api, issue_comment)

cmds = ActiveIssueCommands.select().order_by(ActiveIssueCommands.seconds_remaining)
for cmd in cmds:
Expand Down

0 comments on commit f2a2130

Please sign in to comment.