Search in sources :

Example 1 with RetryPolicy

use of com.android.volley.RetryPolicy in project SimplifyReader by chentao0707.

the class BasicNetwork method attemptRetryOnException.

/**
     * Attempts to prepare the request for a retry. If there are no more attempts remaining in the
     * request's retry policy, a timeout exception is thrown.
     * @param request The request to use.
     */
private static void attemptRetryOnException(String logPrefix, Request<?> request, VolleyError exception) throws VolleyError {
    RetryPolicy retryPolicy = request.getRetryPolicy();
    int oldTimeout = request.getTimeoutMs();
    try {
        retryPolicy.retry(exception);
    } catch (VolleyError e) {
        request.addMarker(String.format("%s-timeout-giveup [timeout=%s]", logPrefix, oldTimeout));
        throw e;
    }
    request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
}
Also used : VolleyError(com.android.volley.VolleyError) RetryPolicy(com.android.volley.RetryPolicy)

Example 2 with RetryPolicy

use of com.android.volley.RetryPolicy in project FastDev4Android by jiangqqlmj.

the class BasicNetwork method attemptRetryOnException.

/**
     * Attempts to prepare the request for a retry. If there are no more attempts remaining in the
     * request's retry policy, a timeout exception is thrown.
     * @param request The request to use.
     */
private static void attemptRetryOnException(String logPrefix, Request<?> request, VolleyError exception) throws VolleyError {
    RetryPolicy retryPolicy = request.getRetryPolicy();
    int oldTimeout = request.getTimeoutMs();
    try {
        retryPolicy.retry(exception);
    } catch (VolleyError e) {
        request.addMarker(String.format("%s-timeout-giveup [timeout=%s]", logPrefix, oldTimeout));
        throw e;
    }
    request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
}
Also used : VolleyError(com.android.volley.VolleyError) RetryPolicy(com.android.volley.RetryPolicy)

Example 3 with RetryPolicy

use of com.android.volley.RetryPolicy in project iosched by google.

the class BasicNetwork method attemptRetryOnException.

/**
     * Attempts to prepare the request for a retry. If there are no more attempts remaining in the
     * request's retry policy, a timeout exception is thrown.
     * @param request The request to use.
     */
private static void attemptRetryOnException(String logPrefix, Request<?> request, VolleyError exception) throws VolleyError {
    RetryPolicy retryPolicy = request.getRetryPolicy();
    int oldTimeout = request.getTimeoutMs();
    try {
        retryPolicy.retry(exception);
    } catch (VolleyError e) {
        request.addMarker(String.format("%s-timeout-giveup [timeout=%s]", logPrefix, oldTimeout));
        throw e;
    }
    request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
}
Also used : VolleyError(com.android.volley.VolleyError) RetryPolicy(com.android.volley.RetryPolicy)

Example 4 with RetryPolicy

use of com.android.volley.RetryPolicy in project Douya by DreaminginCodeZH.

the class BasicNetwork method attemptRetryOnException.

/**
     * Attempts to prepare the request for a retry. If there are no more attempts remaining in the
     * request's retry policy, a timeout exception is thrown.
     * @param request The request to use.
     */
private static void attemptRetryOnException(String logPrefix, Request<?> request, VolleyError exception) throws VolleyError {
    RetryPolicy retryPolicy = request.getRetryPolicy();
    int oldTimeout = request.getTimeoutMs();
    try {
        retryPolicy.retry(exception);
    } catch (VolleyError e) {
        request.addMarker(String.format("%s-giveup [timeout=%s]", logPrefix, oldTimeout));
        throw e;
    }
    request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
}
Also used : VolleyError(com.android.volley.VolleyError) RetryPolicy(com.android.volley.RetryPolicy)

Example 5 with RetryPolicy

use of com.android.volley.RetryPolicy in project OkVolley by googolmo.

the class OkNetwork method attemptRetryOnException.

/**
     * Attempts to prepare the request for a retry. If there are no more attempts remaining in the
     * request's retry policy, a timeout exception is thrown.
     *
     * @param request The request to use.
     */
private static void attemptRetryOnException(String logPrefix, Request<?> request, VolleyError exception) throws VolleyError {
    RetryPolicy retryPolicy = request.getRetryPolicy();
    int oldTimeout = request.getTimeoutMs();
    try {
        retryPolicy.retry(exception);
    } catch (VolleyError e) {
        request.addMarker(String.format("%s-timeout-giveup [timeout=%s]", logPrefix, oldTimeout));
        throw e;
    }
    request.addMarker(String.format("%s-retry [timeout=%s]", logPrefix, oldTimeout));
}
Also used : VolleyError(com.android.volley.VolleyError) RetryPolicy(com.android.volley.RetryPolicy)

Aggregations

RetryPolicy (com.android.volley.RetryPolicy)8 VolleyError (com.android.volley.VolleyError)8