Using global caches for instance stats
This commit is contained in:
parent
ad636a445c
commit
90ce3ef3a2
|
|
@ -412,27 +412,29 @@ public class HomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchExchangeDetails(String exchange) {
|
private void fetchExchangeDetails(String exchange) {
|
||||||
new Thread(() -> {
|
showInstanceDetailsDialog(MainActivity.getInstanceCache(exchange).getGlobalStats());
|
||||||
try {
|
// new Thread(() -> {
|
||||||
InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
// try {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> showInstanceDetailsDialog(result));
|
// InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
||||||
} catch (IOException e) {
|
// new Handler(Looper.getMainLooper()).post(() -> showInstanceDetailsDialog(result));
|
||||||
e.printStackTrace();
|
// } catch (IOException e) {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
// e.printStackTrace();
|
||||||
}
|
// new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
||||||
}).start();
|
// }
|
||||||
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchPausedTraders(String exchange) {
|
private void fetchPausedTraders(String exchange) {
|
||||||
new Thread(() -> {
|
showPausedTradersDialog(MainActivity.getInstanceCache(exchange).getGlobalStats());
|
||||||
try {
|
// new Thread(() -> {
|
||||||
InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
// try {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> showPausedTradersDialog(result));
|
// InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
||||||
} catch (IOException e) {
|
// new Handler(Looper.getMainLooper()).post(() -> showPausedTradersDialog(result));
|
||||||
e.printStackTrace();
|
// } catch (IOException e) {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
// e.printStackTrace();
|
||||||
}
|
// new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
||||||
}).start();
|
// }
|
||||||
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchMissingPairs(String exchange) {
|
private void fetchMissingPairs(String exchange) {
|
||||||
|
|
@ -472,15 +474,16 @@ public class HomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchExchangeConfig(String exchange) {
|
private void fetchExchangeConfig(String exchange) {
|
||||||
new Thread(() -> {
|
showInstanceConfigDialog(MainActivity.getInstanceCache(exchange).getGlobalStats());
|
||||||
try {
|
// new Thread(() -> {
|
||||||
InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
// try {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> showInstanceConfigDialog(result));
|
// InstanceInterface.InstanceGlobalStatsData result = InstanceInterface.getInstanceGlobalStatus(exchange, true);
|
||||||
} catch (IOException e) {
|
// new Handler(Looper.getMainLooper()).post(() -> showInstanceConfigDialog(result));
|
||||||
e.printStackTrace();
|
// } catch (IOException e) {
|
||||||
new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
// e.printStackTrace();
|
||||||
}
|
// new Handler(Looper.getMainLooper()).post(() -> Toast.makeText(getContext(), "Failed to fetch details", Toast.LENGTH_SHORT).show());
|
||||||
}).start();
|
// }
|
||||||
|
// }).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showInstanceDetailsDialog(InstanceInterface.InstanceGlobalStatsData result) {
|
private void showInstanceDetailsDialog(InstanceInterface.InstanceGlobalStatsData result) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue