mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-02 19:02:33 +02:00
Reattempt RabbitMQ connection on first attempt
This commit is contained in:
@@ -156,8 +156,19 @@ public class RabbitMQMessenger implements Messenger {
|
|||||||
this.plugin.getLogger().info("RabbitMQ pubsub connection re-established");
|
this.plugin.getLogger().info("RabbitMQ pubsub connection re-established");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception ignored) {
|
} catch (Exception e) {
|
||||||
return false;
|
if (firstStartup) {
|
||||||
|
this.plugin.getLogger().warn("Unable to connect to RabbitMQ, waiting for 5 seconds then retrying...", e);
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
return checkAndReopenConnection(false);
|
||||||
|
} else {
|
||||||
|
this.plugin.getLogger().severe("Unable to connect to RabbitMQ", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user