Skip to content

Commit

Permalink
u proxy detect
Browse files Browse the repository at this point in the history
  • Loading branch information
lcstore committed Jul 14, 2015
1 parent 13b64ef commit 0f85ad4
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,25 @@ public void run() {
Long fromId = 0L;
Long minRetryId = 2863037L;
lastMaxId = lastMaxId < minRetryId ? minRetryId : lastMaxId;
fromId = status == 0 ? lastMaxId : fromId;
while (true) {
List<ProxyDetectDto> dtoList = proxyDetectService.getProxyDetectDtosFromId(fromId, limit,
status);
taskId = UUID.randomUUID().toString();
offerDetectTasks(dtoList, taskId);
if (ProxyDetectDto.STATUS_RETRY == status) {
List<ProxyDetectDto> newList = new ArrayList<ProxyDetectDto>(dtoList.size());
for (ProxyDetectDto dto : dtoList) {
if (dto.getId() >= lastMaxId || dto.getSuccessCount() > 5) {
newList.add(dto);
}
}
dtoList = newList;
}
for (ProxyDetectDto dto : dtoList) {
if (dto.getId() > fromId) {
fromId = dto.getId();
}
}
taskId = UUID.randomUUID().toString();
offerDetectTasks(dtoList, taskId);
totalCount += dtoList.size();
if (dtoList.size() < limit) {
break;
Expand Down

0 comments on commit 0f85ad4

Please sign in to comment.