loottracker: Run database related code in the subscription (#1780)
This commit is contained in:
@@ -352,7 +352,6 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
Completable.fromAction(this::initDatabase).subscribeOn(Schedulers.io()).subscribe();
|
|
||||||
addSubscriptions();
|
addSubscriptions();
|
||||||
|
|
||||||
ignoredItems = Text.fromCSV(config.getIgnoredItems());
|
ignoredItems = Text.fromCSV(config.getIgnoredItems());
|
||||||
@@ -372,10 +371,13 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
|
|
||||||
clientToolbar.addNavigation(navButton);
|
clientToolbar.addNavigation(navButton);
|
||||||
|
|
||||||
|
Completable.fromAction(this::initDatabase)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.subscribe(() ->
|
||||||
|
{
|
||||||
AccountSession accountSession = sessionManager.getAccountSession();
|
AccountSession accountSession = sessionManager.getAccountSession();
|
||||||
if (accountSession != null || this.localPersistence)
|
if (accountSession != null || this.localPersistence)
|
||||||
{
|
{
|
||||||
|
|
||||||
clientThread.invokeLater(() ->
|
clientThread.invokeLater(() ->
|
||||||
{
|
{
|
||||||
switch (client.getGameState())
|
switch (client.getGameState())
|
||||||
@@ -472,6 +474,7 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user