From 5bb02db85994ea0c017894fb49950c67a6db552e Mon Sep 17 00:00:00 2001 From: CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> Date: Sun, 27 Mar 2022 12:16:54 -0500 Subject: Lowest BIN related fixes & optimizations (#101) * Lowest BIN related fixes & optimizations - Fix double-call of updateLowestBin due to a race condition where lastLowestBinUpdate is not updated by the async thread until after the following tick. - Change the parsing of item prices to avoid using getAsInt on a decimal string that throws two exceptions per value parsed. I replaced it with the code that getAsInt ends up falling back to. - Delete corrupted prices_*.gz file so that it can be re-downloaded. - Make the Bazaar update retry after 60 seconds instead of 5 minutes to be consistent with auction average data. * Remove corrupt file deletion code to avoid conflict with other PR --- .../io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java index 63a08d41..66014b1f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java @@ -418,7 +418,7 @@ public class GuiPriceGraph extends GuiScreen { item.getValue().getAsJsonObject().get("curr_sell").getAsFloat() )); else if (!bazaar) - prices.get(item.getKey()).ah.put(epochSecond, item.getValue().getAsInt()); + prices.get(item.getKey()).ah.put(epochSecond, item.getValue().getAsBigDecimal().intValue()); } else { TreeMap mapData = new TreeMap<>(); if (bazaar && item.getValue().getAsJsonObject().has("curr_buy") && item.getValue().getAsJsonObject().has( -- cgit