examine: Move price lookups off executor

Historically price lookup was done by sending a web request on price
lookups, which required calls to be done on an executor. As of
a1ae397e11, client prices are loaded periodically and cached, thus no
longer imposing any thread requirement on price lookup.
This commit is contained in:
Jordan Atwood
2020-05-09 21:16:32 -07:00
committed by Adam
parent 73d928ea89
commit 39a2407b71
2 changed files with 1 additions and 10 deletions

View File

@@ -29,7 +29,6 @@ import com.google.common.cache.CacheBuilder;
import java.time.Instant;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.concurrent.ScheduledExecutorService;
import java.util.regex.Pattern;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
@@ -92,9 +91,6 @@ public class ExaminePlugin extends Plugin
@Inject
private ChatMessageManager chatMessageManager;
@Inject
private ScheduledExecutorService executor;
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
@@ -219,7 +215,7 @@ public class ExaminePlugin extends Plugin
if (itemComposition != null)
{
final int id = itemManager.canonicalize(itemComposition.getId());
executor.submit(() -> getItemPrice(id, itemComposition, itemQuantity));
getItemPrice(id, itemComposition, itemQuantity);
}
}
else

View File

@@ -27,7 +27,6 @@ package net.runelite.client.plugins.examine;
import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
@@ -73,10 +72,6 @@ public class ExaminePluginTest
@Bind
ItemManager itemManager;
@Mock
@Bind
ScheduledExecutorService scheduledExecutorService;
@Before
public void before()
{