Compare commits
14 Commits
0eb965a26d
...
renovate/i
Author | SHA1 | Date | |
---|---|---|---|
4ccd2e207a | |||
0bc614ce39 | |||
499c54c8cf | |||
41f7ca07b0 | |||
5ec61940ac | |||
6665e8a655 | |||
07562eb94d | |||
a78adf67c7 | |||
fc1f51da75 | |||
c796875d8c | |||
82fb2a3d23 | |||
2e326bb7be | |||
c5bf941c54 | |||
4aa5b0a90d |
8
pom.xml
8
pom.xml
@ -133,20 +133,20 @@
|
||||
<dependency>
|
||||
<groupId>io.sentry</groupId>
|
||||
<artifactId>sentry-spring-boot-starter-jakarta</artifactId>
|
||||
<version>7.12.1</version>
|
||||
<version>7.16.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- InfluxDB Metrics -->
|
||||
<dependency>
|
||||
<groupId>com.influxdb</groupId>
|
||||
<artifactId>influxdb-spring</artifactId>
|
||||
<version>7.1.0</version>
|
||||
<version>7.2.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.influxdb</groupId>
|
||||
<artifactId>influxdb-client-java</artifactId>
|
||||
<version>7.1.0</version>
|
||||
<version>7.2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- DNS Lookup -->
|
||||
@ -194,7 +194,7 @@
|
||||
<dependency>
|
||||
<groupId>de.flapdoodle.embed</groupId>
|
||||
<artifactId>de.flapdoodle.embed.mongo.spring3x</artifactId>
|
||||
<version>4.15.0</version>
|
||||
<version>4.16.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -24,7 +24,7 @@ public enum MojangServer {
|
||||
LIBRARIES("Libraries Server", "https://libraries.minecraft.net"),
|
||||
SERVICES("Minecraft Services", "https://api.minecraftservices.com");
|
||||
|
||||
private static final long STATUS_TIMEOUT = TimeUnit.SECONDS.toMillis(4);
|
||||
private static final long STATUS_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
|
||||
|
||||
/**
|
||||
* The name of this server.
|
||||
@ -58,7 +58,7 @@ public enum MojangServer {
|
||||
ex.printStackTrace();
|
||||
} catch (IOException ignored) {
|
||||
// We can safely ignore any errors, we're simply checking
|
||||
// if the host is reachable, if it's not, it's offline.
|
||||
// if the host is reachable, if it's not, then it's offline.
|
||||
}
|
||||
return Status.OFFLINE;
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import xyz.mcutils.backend.model.cache.CachedEndpointStatus;
|
||||
import xyz.mcutils.backend.service.MojangService;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/mojang/", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Tag(name = "Mojang Controller", description = "The Mojang Controller is used to get information about the Mojang APIs.")
|
||||
public class MojangController {
|
||||
|
||||
@Autowired
|
||||
private MojangService mojangService;
|
||||
|
||||
@ -27,6 +27,6 @@ public class MojangController {
|
||||
public ResponseEntity<?> getStatus() {
|
||||
return ResponseEntity.ok()
|
||||
.cacheControl(CacheControl.maxAge(1, TimeUnit.MINUTES).cachePublic())
|
||||
.body(mojangService.getMojangServerStatus());
|
||||
.body(Map.of("endpoints", mojangService.getMojangServerStatus()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user