mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-27 13:21:30 +00:00
Speed up syncthing startup and reduce log spam (#60)
This commit is contained in:
parent
f915331114
commit
ecd44b231f
1 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,8 @@ public class PollWebGuiAvailableTask extends ApiRequest {
|
|||
|
||||
private OnSuccessListener mListener;
|
||||
|
||||
private Integer logIncidence = 0;
|
||||
|
||||
/**
|
||||
* 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);
|
||||
Throwable cause = error.getCause();
|
||||
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 {
|
||||
Log.w(TAG, "Unexpected error while polling web gui", error);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue