reconnect on conncetion refused slowed
This commit is contained in:
parent
64016a859c
commit
2b9b0dab06
|
@ -26,6 +26,7 @@ import org.json.JSONObject;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.ConnectException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
|
@ -443,7 +444,7 @@ public class TelegramAPI implements Runnable {
|
|||
log.log("error getting updates.", e);
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(e instanceof ConnectException ? 10000 : 500);
|
||||
} catch(InterruptedException ignored) {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue