Fixed test
This commit is contained in:
parent
c0a7acc609
commit
49a9e0c5f7
@ -76,7 +76,7 @@ public class JdbcNodeRegistry extends JdbcHelper implements NodeRegistry {
|
||||
ResultSet lastConnectionTime = exists.executeQuery();
|
||||
if (lastConnectionTime.next()) {
|
||||
long time = lastConnectionTime.getLong("time");
|
||||
if (time < node.getTime() && node.getTime() < UnixTime.now()) {
|
||||
if (time < node.getTime() && node.getTime() <= UnixTime.now()) {
|
||||
time = node.getTime();
|
||||
update.setLong(1, node.getServices());
|
||||
update.setLong(2, time);
|
||||
@ -86,7 +86,7 @@ public class JdbcNodeRegistry extends JdbcHelper implements NodeRegistry {
|
||||
update.setLong(5, node.getStream());
|
||||
update.executeUpdate();
|
||||
}
|
||||
} else if (node.getTime() < UnixTime.now()) {
|
||||
} else if (node.getTime() <= UnixTime.now()) {
|
||||
insert.setBytes(1, node.getIPv6());
|
||||
insert.setInt(2, node.getPort());
|
||||
insert.setLong(3, node.getServices());
|
||||
|
@ -40,7 +40,8 @@ public class JdbcNodeRegistryTest {
|
||||
registry.offerAddresses(Arrays.asList(
|
||||
createAddress(1, 8444, 1, now()),
|
||||
createAddress(2, 8444, 1, now()),
|
||||
createAddress(3, 8444, 1, now())
|
||||
createAddress(3, 8444, 1, now()),
|
||||
createAddress(4, 8444, 2, now())
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user