}
findNewTagsTime = System.currentTimeMillis();
}
JTag tag = tags.poll();
long lastMillis = tag.getLastMillis();
if (tag != null && tag.nextQuery()) {
String term = tag.getTerm();
if (term == null) {
// TODO use user search later on
logger.warn("TODO skipping tags with empty terms for now:" + tag);
continue;
}
if (term.isEmpty() || JetwickQuery.containsForbiddenChars(term))
continue;
float waitInSeconds = 1f;
try {
int pages = tag.getPages();
tmpColl.clear();
long newMaxCreateTime = twSearch.search(term + " " + TwitterSearch.LINK_FILTER, tmpColl, pages * 100, 0);
// calc tweets per sec with 'floating mean'
double lastTweetsPerSec = tag.getTweetsPerSec();
int newTweets = guessNewTweets(tmpColl, tag.getMaxCreateTime());
lastTweetsPerSec = lastTweetsPerSec + newTweets / ((System.currentTimeMillis() - lastMillis) / 1000.0);
tag.setTweetsPerSec(lastTweetsPerSec / 2);
tag.setMaxCreateTime(newMaxCreateTime);
logger.info("searched: " + tag + "\t=> tweets:" + tmpColl.size() + "\t newTweets:" + newTweets);
for (JTweet tw : tmpColl) {
try {
resultTweets.put(tw.setFeedSource("search:" + term));
} catch (InterruptedException ex) {