mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2025-02-25 17:01:26 +01:00
Change healthcheck details return type
This commit is contained in:
parent
3707d2f03c
commit
84fce987d5
@ -27,7 +27,7 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
|
|||||||
'https://javadoc.io/static/org.jetbrains/annotations/23.0.0/'
|
'https://javadoc.io/static/org.jetbrains/annotations/23.0.0/'
|
||||||
)
|
)
|
||||||
options.addStringOption('Xdoclint:none', '-quiet')
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
options.addStringOption('-since', '5.0,5.1,5.2,5.3,5.4')
|
options.addStringOption('-since', '5.0,5.1,5.2,5.3,5.4,5.5')
|
||||||
|
|
||||||
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
|
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
|
||||||
options.links.add('https://docs.oracle.com/en/java/javase/11/docs/api/')
|
options.links.add('https://docs.oracle.com/en/java/javase/11/docs/api/')
|
||||||
@ -36,19 +36,9 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
java {
|
||||||
classifier 'javadoc'
|
withJavadocJar()
|
||||||
from javadoc.destinationDir
|
withSourcesJar()
|
||||||
}
|
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
|
||||||
classifier 'sources'
|
|
||||||
from sourceSets.main.allSource
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives javadocJar
|
|
||||||
archives sourcesJar
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@ -70,8 +60,6 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
|
|||||||
artifactId = 'api'
|
artifactId = 'api'
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
artifact sourcesJar
|
|
||||||
artifact javadocJar
|
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
name = 'LuckPerms API'
|
name = 'LuckPerms API'
|
||||||
@ -111,7 +99,6 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
|
|||||||
|
|
||||||
signing {
|
signing {
|
||||||
useGpgCmd()
|
useGpgCmd()
|
||||||
sign configurations.archives
|
|
||||||
sign publishing.publications.mavenJava
|
sign publishing.publications.mavenJava
|
||||||
required = true
|
required = true
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,6 @@ public interface Health {
|
|||||||
*
|
*
|
||||||
* @return details about the healthcheck status
|
* @return details about the healthcheck status
|
||||||
*/
|
*/
|
||||||
Map<String, String> getDetails();
|
Map<String, Object> getDetails();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -408,15 +408,15 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
|||||||
return HealthCheckResult.unhealthy(Collections.singletonMap("reason", "storage disconnected"));
|
return HealthCheckResult.unhealthy(Collections.singletonMap("reason", "storage disconnected"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
if (meta.connected() != null) {
|
if (meta.connected() != null) {
|
||||||
map.put("storageConnected", meta.connected().toString());
|
map.put("storageConnected", meta.connected());
|
||||||
}
|
}
|
||||||
if (meta.ping() != null) {
|
if (meta.ping() != null) {
|
||||||
map.put("storagePing", meta.ping().toString());
|
map.put("storagePing", meta.ping());
|
||||||
}
|
}
|
||||||
if (meta.sizeBytes() != null) {
|
if (meta.sizeBytes() != null) {
|
||||||
map.put("storageSizeBytes", meta.sizeBytes().toString());
|
map.put("storageSizeBytes", meta.sizeBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
return HealthCheckResult.healthy(map);
|
return HealthCheckResult.healthy(map);
|
||||||
|
@ -33,18 +33,18 @@ import java.util.Map;
|
|||||||
public class HealthCheckResult implements Health {
|
public class HealthCheckResult implements Health {
|
||||||
private static final Gson GSON = new Gson();
|
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);
|
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);
|
return new HealthCheckResult(false, details);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final boolean healthy;
|
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.healthy = healthy;
|
||||||
this.details = details;
|
this.details = details;
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ public class HealthCheckResult implements Health {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> getDetails() {
|
public Map<String, Object> getDetails() {
|
||||||
return this.details;
|
return this.details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user