mirror of
https://codeberg.org/NextPush/nextpush-android.git
synced 2024-12-27 10:12:29 +01:00
Count fails since service start
This commit is contained in:
parent
adcf14e499
commit
0a7fe27ca1
@ -11,8 +11,15 @@ import org.unifiedpush.distributor.nextpush.utils.TAG
|
||||
|
||||
object FailureHandler {
|
||||
|
||||
private var ttlFails = 0
|
||||
|
||||
var nFails = 0
|
||||
private set
|
||||
private set(value) {
|
||||
if (value > 0) {
|
||||
ttlFails += 1
|
||||
}
|
||||
field = value
|
||||
}
|
||||
|
||||
private var nFailsBeforePing = 0
|
||||
|
||||
@ -79,6 +86,7 @@ object FailureHandler {
|
||||
}
|
||||
|
||||
fun clearFails() {
|
||||
ttlFails = 0
|
||||
nFails = 0
|
||||
nFailsBeforePing = 0
|
||||
eventSource = null
|
||||
@ -90,7 +98,8 @@ object FailureHandler {
|
||||
}
|
||||
|
||||
fun getDebugInfo(): String {
|
||||
return "nFails: $nFails\n" +
|
||||
return "ttlFails: $ttlFails\n" +
|
||||
"nFails: $nFails\n" +
|
||||
"nFailsBeforePing: $nFailsBeforePing\n" +
|
||||
"eventSource null: ${eventSource == null}"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user