*) Bugfix for userDB time limit calculation

See: http://www.yacy-forum.de/viewtopic.php?p=10949

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@898 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent 1688be8590
commit 3966b38360

@ -57,14 +57,14 @@ import de.anomic.kelondro.kelondroException;
import de.anomic.kelondro.kelondroMap; import de.anomic.kelondro.kelondroMap;
import de.anomic.server.logging.serverLog; import de.anomic.server.logging.serverLog;
public class userDB { public final class userDB {
public static final int USERNAME_MAX_LENGTH = 128; public static final int USERNAME_MAX_LENGTH = 128;
public static final int USERNAME_MIN_LENGTH = 4; public static final int USERNAME_MIN_LENGTH = 4;
kelondroMap userTable; kelondroMap userTable;
private File userTableFile; private final File userTableFile;
private int bufferkb; private final int bufferkb;
public userDB(File userTableFile, int bufferkb) throws IOException { public userDB(File userTableFile, int bufferkb) throws IOException {
this.userTableFile = userTableFile; this.userTableFile = userTableFile;
@ -248,7 +248,7 @@ public class userDB {
long newTimeUsed = oldTimeUsed; long newTimeUsed = oldTimeUsed;
if (decrementTimeUsed) { if (decrementTimeUsed) {
if ((lastAccess == null)||((lastAccess != null)||(lastAccess.longValue()-timeStamp>1000))) { if ((lastAccess == null)||((lastAccess != null)&&(timeStamp-lastAccess.longValue()>=1000*60))) {
this.mem.put(TIME_USED,Long.toString(newTimeUsed = ++oldTimeUsed)); this.mem.put(TIME_USED,Long.toString(newTimeUsed = ++oldTimeUsed));
} }
} }

Loading…
Cancel
Save