Skip to content

Commit

Permalink
Fix attempt to use non-finite number in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
freyacodes committed Nov 9, 2018
1 parent 8d37af5 commit 3c6b571
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ private void sendStats() {
JSONObject cpu = new JSONObject();
cpu.put("cores", Runtime.getRuntime().availableProcessors());
cpu.put("systemLoad", hal.getProcessor().getSystemCpuLoad());
cpu.put("lavalinkLoad", getProcessRecentCpuUsage());
double load = getProcessRecentCpuUsage();
if (!Double.isFinite(load)) load = 0;
cpu.put("lavalinkLoad", load);

out.put("cpu", cpu);

Expand Down

0 comments on commit 3c6b571

Please sign in to comment.