mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-12 06:48:50 +02:00
Fixed multiple network boxes caused by previous commit
This commit is contained in:
parent
eba17eb127
commit
9347ee383a
@ -129,13 +129,14 @@ public class TransferTable extends Table {
|
||||
List<String> split = Base64Util.split(encodedHtml, 500000L);
|
||||
|
||||
int i = 0;
|
||||
long expires = MiscUtils.getTime() + TimeAmount.MINUTE.ms();
|
||||
for (String part : split) {
|
||||
final int partNumber = i;
|
||||
execute(new ExecStatement(insertStatementParts) {
|
||||
@Override
|
||||
public void prepare(PreparedStatement statement) throws SQLException {
|
||||
statement.setString(1, ServerInfo.getServerUUID().toString());
|
||||
statement.setLong(2, MiscUtils.getTime() + TimeAmount.MINUTE.ms());
|
||||
statement.setLong(2, expires);
|
||||
statement.setString(3, CacheAnalysisPageRequest.class.getSimpleName().toLowerCase());
|
||||
statement.setString(4, serverUUID.toString());
|
||||
statement.setString(5, part);
|
||||
@ -170,11 +171,18 @@ public class TransferTable extends Table {
|
||||
@Override
|
||||
public Map<UUID, String> processResults(ResultSet set) throws SQLException {
|
||||
Map<UUID, String> htmlPerUUID = new HashMap<>();
|
||||
Map<UUID, Long> expiry = new HashMap<>();
|
||||
while (set.next()) {
|
||||
String uuidString = set.getString(Col.EXTRA_VARIABLES.get());
|
||||
UUID uuid = UUID.fromString(uuidString);
|
||||
|
||||
htmlPerUUID.put(uuid, htmlPerUUID.getOrDefault(uuid, "") + set.getString(Col.CONTENT.get()));
|
||||
long expires = set.getLong(Col.EXPIRY.get());
|
||||
|
||||
long correctExpiry = expiry.getOrDefault(uuid, expires);
|
||||
if (expires == correctExpiry) {
|
||||
htmlPerUUID.put(uuid, htmlPerUUID.getOrDefault(uuid, "") + set.getString(Col.CONTENT.get()));
|
||||
expiry.put(uuid, correctExpiry);
|
||||
}
|
||||
}
|
||||
return htmlPerUUID;
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ import com.djrapitops.plan.system.info.request.InfoRequest;
|
||||
import com.djrapitops.plan.system.info.request.SendDBSettingsRequest;
|
||||
import com.djrapitops.plan.system.info.server.Server;
|
||||
import com.djrapitops.plan.system.info.server.ServerInfo;
|
||||
import com.djrapitops.plan.system.processing.Processor;
|
||||
import com.djrapitops.plan.system.webserver.WebServerSystem;
|
||||
import com.djrapitops.plugin.api.Check;
|
||||
import com.djrapitops.plugin.api.utility.log.Log;
|
||||
@ -122,16 +121,6 @@ public abstract class InfoSystem implements SubSystem {
|
||||
@Override
|
||||
public void enable() throws EnableException {
|
||||
connectionSystem.enable();
|
||||
Processor.queue(() -> {
|
||||
try {
|
||||
updateNetworkPage();
|
||||
} catch (NoServersException e) {
|
||||
/* Ignored */
|
||||
} catch (WebException e) {
|
||||
// TODO Exception handling
|
||||
Log.toLog(this.getClass(), e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user