avoid div. by zero

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7136 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 14 years ago
parent 2c7edea35e
commit d2a3d08c44

@ -118,7 +118,7 @@ public class MediawikiImporter extends Thread implements Importer {
*/ */
public int speed() { public int speed() {
if (count == 0) return 0; if (count == 0) return 0;
return (int) ((long) count / runningTime()); return (int) ((long) count / Math.max(1L, runningTime() ));
} }
/** /**
@ -126,11 +126,11 @@ public class MediawikiImporter extends Thread implements Importer {
* @return * @return
*/ */
public long remainingTime() { public long remainingTime() {
return Math.max(0, this.approxdocs - count) / speed(); return Math.max(0, this.approxdocs - count) / Math.max(1, speed() );
} }
public long runningTime() { public long runningTime() {
return (System.currentTimeMillis() - start) / 1024; return (System.currentTimeMillis() - start) / 1000L;
} }
public void run() { public void run() {

Loading…
Cancel
Save