Skip to content
Snippets Groups Projects
Commit 16f0b33d authored by Terry Liao's avatar Terry Liao
Browse files

add waiting strategy for tweet_search

parent 20952a8c
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
import json
import os
import time
import couchdb
import tweepy
from tweepy import OAuthHandler
......@@ -82,7 +83,12 @@ def run(server_path):
ids = list()
a = TweetSearchHavester(couch)
while True:
print("start a new round")
ids = list()
# if user id pool less than 40, won't start for query search
if(len(db) < 40):
time.wait(100)
continue
print("start a new round on search")
for id in db:
data = db[id]
if(not data['isSearched']):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment