Twitter: move timer reregistration up to the top of the timer routine

twitter will occasionally fail hard, when it was doing so this
check for updates wasn't reregistering, making the bot stop
checking eventually
This commit is contained in:
Brian S. Stephan 2011-03-21 18:23:59 -05:00
parent 5913a95165
commit 9a4f8b019a
1 changed files with 3 additions and 3 deletions

View File

@ -236,6 +236,9 @@ class Twitter(Module):
def _check_self_timeline(self):
"""Check my timeline, and if there are entries, print them to the channel."""
# re-register this check
Timer(300, self._check_self_timeline, ()).start()
if self.authed:
# get the id of the last check we made
since_id = self._get_last_since_id()
@ -263,9 +266,6 @@ class Twitter(Module):
# set since_id
self._set_last_since_id(new_since_id)
# re-register this check
Timer(300, self._check_self_timeline, ()).start()
def _return_tweet_or_retweet_text(self, tweet, print_source=False):
"""
Return a string of the author and text body of a status,