mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-08 21:30:55 +02:00
Change healthcheck details return type
This commit is contained in:
@@ -408,15 +408,15 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
||||
return HealthCheckResult.unhealthy(Collections.singletonMap("reason", "storage disconnected"));
|
||||
}
|
||||
|
||||
Map<String, String> map = new LinkedHashMap<>();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
if (meta.connected() != null) {
|
||||
map.put("storageConnected", meta.connected().toString());
|
||||
map.put("storageConnected", meta.connected());
|
||||
}
|
||||
if (meta.ping() != null) {
|
||||
map.put("storagePing", meta.ping().toString());
|
||||
map.put("storagePing", meta.ping());
|
||||
}
|
||||
if (meta.sizeBytes() != null) {
|
||||
map.put("storageSizeBytes", meta.sizeBytes().toString());
|
||||
map.put("storageSizeBytes", meta.sizeBytes());
|
||||
}
|
||||
|
||||
return HealthCheckResult.healthy(map);
|
||||
|
@@ -33,18 +33,18 @@ import java.util.Map;
|
||||
public class HealthCheckResult implements Health {
|
||||
private static final Gson GSON = new Gson();
|
||||
|
||||
public static HealthCheckResult healthy(Map<String, String> details) {
|
||||
public static HealthCheckResult healthy(Map<String, Object> details) {
|
||||
return new HealthCheckResult(true, details);
|
||||
}
|
||||
|
||||
public static HealthCheckResult unhealthy(Map<String, String> details) {
|
||||
public static HealthCheckResult unhealthy(Map<String, Object> details) {
|
||||
return new HealthCheckResult(false, details);
|
||||
}
|
||||
|
||||
private final boolean healthy;
|
||||
private final Map<String, String> details;
|
||||
private final Map<String, Object> details;
|
||||
|
||||
HealthCheckResult(boolean healthy, Map<String, String> details) {
|
||||
HealthCheckResult(boolean healthy, Map<String, Object> details) {
|
||||
this.healthy = healthy;
|
||||
this.details = details;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class HealthCheckResult implements Health {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getDetails() {
|
||||
public Map<String, Object> getDetails() {
|
||||
return this.details;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user