Skip to content

Commit

Permalink
Merge pull request #5 from peoplefund-tech/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
waegaein authored May 14, 2019
2 parents dbe8c6b + cc4b5d0 commit 165b6e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion slaccato/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import signal
import sys
import traceback
import time
from concurrent.futures import (
ThreadPoolExecutor,
as_completed,
Expand Down Expand Up @@ -133,6 +134,7 @@ def __init__(self,
std_err_path='slack_bot_error.log',
pid_file_path='slack_bot.pid',
pid_file_timeout=5,
polling_interval_milliseconds=None,
exception_callback=None,
default_method=DefaultMethod):

Expand All @@ -146,6 +148,8 @@ def __init__(self,
self.pidfile_path = pid_file_path
self.pidfile_timeout = pid_file_timeout

self.polling_interval_milliseconds = polling_interval_milliseconds

self.slack_bot_token = slack_bot_token
self.slack_bot_name = slack_bot_name

Expand Down Expand Up @@ -291,7 +295,9 @@ def _handle_command_loop(self):
if self.exception_callback:
self.exception_callback(e)
self.exit_gracefully(signal.SIGTERM, None)
# time.sleep(settings.SLACK_READ_WEB_SOCKET_DELAY)

if self.polling_interval_milliseconds is not None:
time.sleep(self.polling_interval_milliseconds / 1000)

def _parse_slack_output(self, slack_rtm_output):
"""
Expand Down

0 comments on commit 165b6e4

Please sign in to comment.