mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
ups
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3355 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
8c1d2e0227
commit
dda24fcb85
|
@ -155,12 +155,12 @@ public class plasmaCrawlBalancer {
|
|||
if (lastAccess != null) {
|
||||
// this is not the first access of the same domain
|
||||
long la = lastAccess.longValue();
|
||||
if (System.currentTimeMillis() - la > minimumDelta) {
|
||||
if (System.currentTimeMillis() - la < minimumDelta) {
|
||||
// force a busy waiting here
|
||||
// in best case, this should never happen if the balancer works propertly
|
||||
// this is only to protect against the worst case, where the crawler could
|
||||
// behave in a DoS-manner
|
||||
long sleeptime = System.currentTimeMillis() - la - minimumDelta;
|
||||
long sleeptime = minimumDelta - (System.currentTimeMillis() - la);
|
||||
if (sleeptime > 0) try {this.wait(sleeptime);} catch (InterruptedException e) {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user