diff options
| author | CraftyOldMiner <85420839+CraftyOldMiner@users.noreply.github.com> | 2022-03-27 12:16:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-27 19:16:54 +0200 |
| commit | 5bb02db85994ea0c017894fb49950c67a6db552e (patch) | |
| tree | 51a0d1c5fa3c60baa8609086187bf3cd49b1d193 /src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java | |
| parent | 9d763c980646510b483d2460b45cf1ff2f3ba4db (diff) | |
| download | notenoughupdates-5bb02db85994ea0c017894fb49950c67a6db552e.tar.gz notenoughupdates-5bb02db85994ea0c017894fb49950c67a6db552e.tar.bz2 notenoughupdates-5bb02db85994ea0c017894fb49950c67a6db552e.zip | |
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
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiPriceGraph.java | 2 |
1 files changed, 1 insertions, 1 deletions
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<Long, Object> mapData = new TreeMap<>(); if (bazaar && item.getValue().getAsJsonObject().has("curr_buy") && item.getValue().getAsJsonObject().has( |
