This commit is contained in:
GoXLR 2022-10-19 09:31:07 +02:00
parent 635c1c9c75
commit 697dd58b46
No known key found for this signature in database
GPG Key ID: 5B163CA341BAA2EA
2 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,7 @@ public final class POSTServerGroups implements Handler<RoutingContext> {
String image = requestBody.getString("image");
ServerGroup serverGroup = new ServerGroup(id, image);
SyncUtils.<Void>runBlocking(v -> serverGroup.insert(v));
SyncUtils.<Void>runBlocking(serverGroup::insert);
if (requestBody.containsKey("addedBy")) {
AuditLog.log(UuidUtils.parseUuid(requestBody.getString("addedBy")), requestBody.getString("addedByIp"), ctx, AuditLogActionType.SERVER_GROUP_CREATE, ImmutableMap.of("serverGroupId", id), (ignored, error) -> {

View File

@ -75,14 +75,16 @@ public final class POSTServersHeartbeat implements Handler<RoutingContext> {
private Future<Void> createInfoResponse(Server server, double tps, Map<UUID, String> playerNames) {
Future<Void> callback = Future.future();
server.receivedHeartbeat(tps, playerNames.keySet());
server.save((ignored, error) -> {
if (error != null) {
callback.fail(error);
} else {
callback.complete();
}
});
if (server != null && playerNames != null) {
server.receivedHeartbeat(tps, playerNames.keySet());
server.save((ignored, error) -> {
if (error != null) {
callback.fail(error);
} else {
callback.complete();
}
});
}
return callback;
}