mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Add timeout to network messages
This commit is contained in:
1 parent
98931c1900
commit
d368befabd
2 files changed
+9
-7
No files matched your search
@@ -165,8 +165,10 @@ public class TeleportManager {
|
||||
MessagePayload.withPosition(position),
|
||||
Message.RelayType.MESSAGE,
|
||||
plugin.getSettings().clusterId))
|
||||
.orTimeout(3, TimeUnit.SECONDS)
|
||||
.exceptionally(throwable -> null)
|
||||
.thenApply(result -> {
|
||||
if (result.payload.teleportResult == null) {
|
||||
if (result == null || result.payload.teleportResult == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(result.payload.teleportResult);
|
||||
|
||||
Reference in new issue
Block a user