diff options
author | Ryan Huber <rhuber@gmail.com> | 2016-09-26 14:08:11 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2016-09-26 14:08:11 -0700 |
commit | e561bc54d36d897d6c46e328141100d8ee80a1b4 (patch) | |
tree | c195bc98717badd9f50e7e7630d092b1f3817b1a | |
parent | dbeb8e8cfa4024665a6bb3708cfe016701b878fb (diff) | |
download | wee-slack-e561bc54d36d897d6c46e328141100d8ee80a1b4.tar.gz |
combines mithrandir's fix and retry logic backwards fix
-rw-r--r-- | wee_slack.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 65793fc..68c8284 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -90,7 +90,7 @@ class SearchList(list): super(SearchList, self).__init__(self) def find(self, name): - if name in self.hashtable.keys(): + if name in self.hashtable: return self.hashtable[name] #this is a fallback to __eq__ if the item isn't in the hashtable already if self.count(name) > 0: @@ -212,7 +212,7 @@ class SlackServer(object): If we haven't tried to connect OR we tried and never heard back and it has been 125 seconds consider the attempt dead and try again """ - if self.connection_attempt_time == 0 or self.connection_attempt_time + 125 > int(time.time()): + if self.connection_attempt_time == 0 or self.connection_attempt_time + 125 < int(time.time()): return True else: return False |