aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorclarkohw <clark_oh-willeke@brown.edu>2021-04-19 03:01:48 -0400
committerclarkohw <clark_oh-willeke@brown.edu>2021-04-19 03:01:48 -0400
commit0508b076ac948a11bde14cfa9f5261796d890ef2 (patch)
treea22f1803b10093561283f5ce03135dab49e5b538 /src/main
parent8e76bf15c53c540a72a273ec560a624dfb7e11df (diff)
caching of prices profit
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java b/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java
index fe12612..77c1c3a 100644
--- a/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java
+++ b/src/main/java/edu/brown/cs/student/term/profit/ProfitCalculation.java
@@ -251,6 +251,7 @@ public class ProfitCalculation {
JSONArray object = new JSONObject(response.body()).getJSONArray(ticker);
try {
double endPrice = object.getJSONObject(object.length() - 1).getDouble("c");
+ currentStockPrices.put(ticker, endPrice);
return endPrice;
} catch (JSONException e) {
currentStockPrices.put(ticker, -1.0);