def start(self): while self.run: try: user_agent = ("Reddit Mining Feeder Lancaster 1.0 by /u/danjamker " "github.com/danjamker/Reddit/") r = praw.Reddit(user_agent=user_agent) while self.run: all_comments = r.get_comments('all') for comment in all_comments: tmp = Tools.serilize(comment.submission) self.logger.info(tmp["id"]) self.db.insert_stream_thread(tmp) mineReddit.delay(tmp["id"]) except Exception as e: self.logger.error("{0} : Unexpected error GetAllComment.py-start: {1}".format(datetime.now().strftime("%c"), e.args)) time.sleep(60)