mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-05 02:19:52 +01:00
Throw console warning on slow economy api call.
This commit is contained in:
parent
3042151fee
commit
af2c514f2a
@ -393,6 +393,18 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
|
||||
@Override
|
||||
public BigDecimal getMoney()
|
||||
{
|
||||
final long start = System.nanoTime();
|
||||
final BigDecimal value = _getMoney();
|
||||
final long elapsed = start - System.nanoTime();
|
||||
if (elapsed > 20000000L)
|
||||
{
|
||||
ess.getLogger().log(Level.INFO, "Lag Notice - Slow Economy Response - Request took over {0}ms!", elapsed / 1000000);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private BigDecimal _getMoney()
|
||||
{
|
||||
if (ess.getPaymentMethod().hasMethod())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user