mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Merge pull request #44 from regaw-leinad/master
Use seconds for heartbeat processing
This commit is contained in:
commit
e8bb9a40fe
@ -258,7 +258,7 @@ public final class RedisBungee extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpRsc.hset("heartbeats", configuration.getServerId(), String.valueOf(System.currentTimeMillis()));
|
tmpRsc.hset("heartbeats", configuration.getServerId(), tmpRsc.time().get(0));
|
||||||
|
|
||||||
long uuidCacheSize = tmpRsc.hlen("uuid-cache");
|
long uuidCacheSize = tmpRsc.hlen("uuid-cache");
|
||||||
if (uuidCacheSize > 750000) {
|
if (uuidCacheSize > 750000) {
|
||||||
@ -454,7 +454,8 @@ public final class RedisBungee extends Plugin {
|
|||||||
} else if (rsc.hexists("heartbeats", serverId)) {
|
} else if (rsc.hexists("heartbeats", serverId)) {
|
||||||
try {
|
try {
|
||||||
long value = Long.parseLong(rsc.hget("heartbeats", serverId));
|
long value = Long.parseLong(rsc.hget("heartbeats", serverId));
|
||||||
if (System.currentTimeMillis() < value + 20000) {
|
long redisTime = getRedisTime(rsc.time());
|
||||||
|
if (redisTime < value + 20) {
|
||||||
getLogger().severe("You have launched a possible impostor BungeeCord instance. Another instance is already running.");
|
getLogger().severe("You have launched a possible impostor BungeeCord instance. Another instance is already running.");
|
||||||
getLogger().severe("For data consistency reasons, RedisBungee will now disable itself.");
|
getLogger().severe("For data consistency reasons, RedisBungee will now disable itself.");
|
||||||
getLogger().severe("If this instance is coming up from a crash, create a file in your RedisBungee plugins directory with the name 'restarted_from_crash.txt' and RedisBungee will not perform this check.");
|
getLogger().severe("If this instance is coming up from a crash, create a file in your RedisBungee plugins directory with the name 'restarted_from_crash.txt' and RedisBungee will not perform this check.");
|
||||||
|
Loading…
Reference in New Issue
Block a user