mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-24 19:06:37 +00:00
Speed up syncthing startup and reduce log spam (#60)
This commit is contained in:
parent
ebb26d6a4b
commit
3eab8fe132
1 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,8 @@ public class PollWebGuiAvailableTask extends ApiRequest {
|
||||||
|
|
||||||
private OnSuccessListener mListener;
|
private OnSuccessListener mListener;
|
||||||
|
|
||||||
|
private Integer logIncidence = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object that must be locked upon accessing mListener
|
* Object that must be locked upon accessing mListener
|
||||||
*/
|
*/
|
||||||
|
@ -74,7 +76,11 @@ public class PollWebGuiAvailableTask extends ApiRequest {
|
||||||
mHandler.postDelayed(this::performRequest, WEB_GUI_POLL_INTERVAL);
|
mHandler.postDelayed(this::performRequest, WEB_GUI_POLL_INTERVAL);
|
||||||
Throwable cause = error.getCause();
|
Throwable cause = error.getCause();
|
||||||
if (cause == null || cause.getClass().equals(ConnectException.class)) {
|
if (cause == null || cause.getClass().equals(ConnectException.class)) {
|
||||||
Log.v(TAG, "Polling web gui");
|
// Reduce lag caused by massively logging the same line while waiting.
|
||||||
|
logIncidence++;
|
||||||
|
if (logIncidence == 1 || logIncidence % 10 == 0) {
|
||||||
|
Log.v(TAG, "Polling web gui ... (" + logIncidence + ")");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Unexpected error while polling web gui", error);
|
Log.w(TAG, "Unexpected error while polling web gui", error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue