degraded status if response time is more than 1 second
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m35s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m35s
This commit is contained in:
parent
348edfd1ef
commit
2895525412
@ -30,8 +30,22 @@ public final class CachedEndpointStatus implements Serializable {
|
|||||||
private long cached;
|
private long cached;
|
||||||
|
|
||||||
public enum Status {
|
public enum Status {
|
||||||
|
/**
|
||||||
|
* The service is online and operational.
|
||||||
|
*/
|
||||||
ONLINE,
|
ONLINE,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The service is degraded and may not be fully operational.
|
||||||
|
* <p>
|
||||||
|
* This could be due to high load or other issues.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
DEGRADED,
|
DEGRADED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The service is offline and not operational.
|
||||||
|
*/
|
||||||
OFFLINE
|
OFFLINE
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -204,7 +204,7 @@ public class MojangService {
|
|||||||
if (endpoint.getAllowedStatuses().contains(response.getStatusCode())) {
|
if (endpoint.getAllowedStatuses().contains(response.getStatusCode())) {
|
||||||
online = true;
|
online = true;
|
||||||
}
|
}
|
||||||
if (online && System.currentTimeMillis() - start > 500) { // If the response took longer than 500ms
|
if (online && System.currentTimeMillis() - start > 1000) { // If the response took longer than 1 second
|
||||||
return CachedEndpointStatus.Status.DEGRADED;
|
return CachedEndpointStatus.Status.DEGRADED;
|
||||||
}
|
}
|
||||||
return online ? CachedEndpointStatus.Status.ONLINE : CachedEndpointStatus.Status.OFFLINE;
|
return online ? CachedEndpointStatus.Status.ONLINE : CachedEndpointStatus.Status.OFFLINE;
|
||||||
|
Loading…
Reference in New Issue
Block a user