- Added wrtie timeout for the faucet request

- Change the equivalent url to use the BTS serve
-
This commit is contained in:
Henry Varona 2018-09-18 15:47:15 -04:00
parent e601b90a63
commit c818eaf472
5 changed files with 8 additions and 20 deletions

1
.gitignore vendored
View file

@ -13,6 +13,7 @@ bin/
gen/ gen/
out/ out/
.idea/ .idea/
tmp/
# Gradle files # Gradle files
.gradle/ .gradle/

View file

@ -7,7 +7,6 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor;
@ -147,6 +146,7 @@ public abstract class BitsharesFaucetApiGenerator {
private static HttpLoggingInterceptor logging; private static HttpLoggingInterceptor logging;
private static OkHttpClient.Builder clientBuilder; private static OkHttpClient.Builder clientBuilder;
private static Retrofit.Builder builder; private static Retrofit.Builder builder;
private static final long TIMEOUT = 30;
private static HashMap<Class<?>, Object> Services; private static HashMap<Class<?>, Object> Services;
@ -184,8 +184,9 @@ public abstract class BitsharesFaucetApiGenerator {
return chain.proceed(request); return chain.proceed(request);
} }
}); });
clientBuilder.readTimeout(5, TimeUnit.MINUTES); clientBuilder.readTimeout(TIMEOUT, TimeUnit.SECONDS)
clientBuilder.connectTimeout(5, TimeUnit.MINUTES); .connectTimeout(TIMEOUT, TimeUnit.SECONDS)
.writeTimeout(TIMEOUT,TimeUnit.SECONDS);
OkHttpClient client = clientBuilder.build(); OkHttpClient client = clientBuilder.build();
Retrofit retrofit = builder.client(client).build(); Retrofit retrofit = builder.client(client).build();
return retrofit.create(serviceClass); return retrofit.create(serviceClass);

View file

@ -573,7 +573,7 @@ public abstract class GrapheneApiGenerator {
public void onError(BaseResponse.Error error) { public void onError(BaseResponse.Error error) {
request.getListener().fail(request.getId()); request.getListener().fail(request.getId());
} }
}), BitsharesConstant.EQUIVALENT_URL); //todo change equivalent url for current server url }), CryptoNetManager.getURL(CryptoNet.BITSHARES)); //todo change equivalent url for current server url
thread.start(); thread.start();
} }
@ -589,7 +589,7 @@ public abstract class GrapheneApiGenerator {
for(BitsharesAsset quoteAsset : quoteAssets){ for(BitsharesAsset quoteAsset : quoteAssets){
WebSocketThread thread = new WebSocketThread(new GetLimitOrders(baseAsset.getBitsharesId(), WebSocketThread thread = new WebSocketThread(new GetLimitOrders(baseAsset.getBitsharesId(),
quoteAsset.getBitsharesId(), 10, new EquivalentValueListener(baseAsset, quoteAsset.getBitsharesId(), 10, new EquivalentValueListener(baseAsset,
quoteAsset,context)), BitsharesConstant.EQUIVALENT_URL); //todo change equivalent url for current server url quoteAsset,context)), CryptoNetManager.getURL(CryptoNet.BITSHARES)); //todo change equivalent url for current server url
thread.start(); thread.start();
} }
} }

View file

@ -43,11 +43,6 @@ public class CrystalApplication extends Application {
"ws://185.208.208.147:8090" // Custom node "ws://185.208.208.147:8090" // Custom node
}; };
public static String BITSHARES_TESTNET_URL[] =
{
"http://185.208.208.147:11012", // Openledger node
};
//This is for testing the equivalent values on the testnet TODO remove //This is for testing the equivalent values on the testnet TODO remove
public static BitsharesAsset bitUSDAsset = new BitsharesAsset("USD",4,"1.3.121",BitsharesAsset.Type.SMART_COIN); public static BitsharesAsset bitUSDAsset = new BitsharesAsset("USD",4,"1.3.121",BitsharesAsset.Type.SMART_COIN);
//This is for testing the equivalent values on the testnet TODO remove //This is for testing the equivalent values on the testnet TODO remove

View file

@ -11,17 +11,8 @@ import cy.agorise.graphenej.models.WitnessResponse;
*/ */
public class BitsharesCryptoNetVerifier extends CryptoNetVerifier { public class BitsharesCryptoNetVerifier extends CryptoNetVerifier {
/**
* TODO We need to change this to a type of subCryptoNet
*/
private final CryptoNet cryptoNet = CryptoNet.BITSHARES; private final CryptoNet cryptoNet = CryptoNet.BITSHARES;
/** private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet
* Todo info need to be on the SubCryptoNet
*/
private final String CHAIN_ID = "9cf6f255a208100d2bb275a3c52f4b1589b7ec9c9bfc2cb2a5fe6411295106d8";//testnet
//private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet
@Override @Override
public void checkURL(final String url) { public void checkURL(final String url) {