forked from unimatrix/web
Check live kit receipt database readiness at addon startup
This commit is contained in:
parent
dbd05c1f04
commit
620c7f6e4b
1 changed files with 8 additions and 0 deletions
|
|
@ -44,6 +44,14 @@ public final class DuneKits extends JavaPlugin implements CommandExecutor, org.b
|
|||
getServer().getScheduler().runTaskTimer(this, () -> {
|
||||
for (Player player : getServer().getOnlinePlayers()) { upgradeFactionIssues(player); request(player); }
|
||||
}, 100L, 200L);
|
||||
getServer().getScheduler().runTaskAsynchronously(this, () -> {
|
||||
try (Connection connection = connect(); PreparedStatement query = connection.prepareStatement(KitDeliverySQL.pending(mysql(connection)))) {
|
||||
identity(query, 1, new UUID(0, 0), mysql(connection));
|
||||
try (ResultSet ignored = query.executeQuery()) {
|
||||
getLogger().info("Paid kit delivery ready (" + connection.getMetaData().getDatabaseProductName() + " inventory).");
|
||||
}
|
||||
} catch (Exception ex) { getLogger().severe("Paid kit delivery database unavailable; claims will remain queued: " + ex.getClass().getSimpleName()); }
|
||||
});
|
||||
}
|
||||
|
||||
@Override public void onDisable() { inflight.clear(); notices.clear(); }
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff