Skip to content

Commit

Permalink
Merge pull request #95 from dowjones/fix_bot_status
Browse files Browse the repository at this point in the history
Add Fix for hammer bot "status" command.
  • Loading branch information
pranav1688 authored Aug 5, 2019
2 parents f2a8bf6 + df11552 commit 9654d30
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion hammer/reporting-remediation/bot/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ def status(message):
else:
response += f"`disabled`"
response += "\n"
message.reply(response)
# FIXME this is workaround to issues "lost websocket connection, try to reconnect now" that
# happens after we send accounts' statuses to slack. The message is long, however slack should handle
# this case and truncate the message without closing connection. I limited the size of message to 15000
# which seems to work.
msg_length = 15000
msg_start = 0
while msg_start < len(response):
message.reply(response[msg_start:msg_start + msg_length])
msg_start = msg_start + msg_length


@respond_to('^(?P<section>.*) config$', re.IGNORECASE)
Expand Down

0 comments on commit 9654d30

Please sign in to comment.