Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
QuasselDroid-ng
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Janne Mareike Koschinski
QuasselDroid-ng
Commits
8fd75e35
Verified
Commit
8fd75e35
authored
6 years ago
by
Janne Mareike Koschinski
Browse files
Options
Downloads
Patches
Plain Diff
Fuck it, just work around the deep sleep stuff
parent
95b8f07d
No related branches found
No related tags found
No related merge requests found
Pipeline
#243
passed
6 years ago
Stage: build
Stage: deploy-local
Stage: deploy-beta
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/de/kuschku/quasseldroid/service/AndroidHeartBeatRunner.kt
+5
-3
5 additions, 3 deletions
...de/kuschku/quasseldroid/service/AndroidHeartBeatRunner.kt
with
5 additions
and
3 deletions
app/src/main/java/de/kuschku/quasseldroid/service/AndroidHeartBeatRunner.kt
+
5
−
3
View file @
8fd75e35
...
@@ -15,16 +15,18 @@ class AndroidHeartBeatRunner(
...
@@ -15,16 +15,18 @@ class AndroidHeartBeatRunner(
)
:
HeartBeatRunner
{
)
:
HeartBeatRunner
{
private
var
running
=
true
private
var
running
=
true
private
var
lastHeartBeatReply
:
Instant
=
Instant
.
now
()
private
var
lastHeartBeatReply
:
Instant
=
Instant
.
now
()
private
var
lastHeartBeatSend
:
Instant
=
Instant
.
now
()
override
fun
start
()
{
override
fun
start
()
{
if
(
running
)
{
if
(
running
)
{
val
now
=
Instant
.
now
()
val
duration
=
Duration
.
between
(
lastHeartBeatReply
,
lastHeartBeatSend
).
toMillis
()
val
duration
=
Duration
.
between
(
lastHeartBeatReply
,
now
).
toMillis
()
if
(
duration
>
TIMEOUT
)
{
if
(
duration
>
TIMEOUT
)
{
log
(
INFO
,
"Heartbeat"
,
"Ping Timeout: Last Response ${duration}ms ago"
)
log
(
INFO
,
"Heartbeat"
,
"Ping Timeout: Last Response ${duration}ms ago"
)
session
.
close
()
session
.
close
()
}
else
{
}
else
{
log
(
INFO
,
"Heartbeat"
,
"Sending Heartbeat"
)
log
(
INFO
,
"Heartbeat"
,
"Sending Heartbeat"
)
val
now
=
Instant
.
now
()
lastHeartBeatSend
=
now
session
.
dispatch
(
SignalProxyMessage
.
HeartBeat
(
now
))
session
.
dispatch
(
SignalProxyMessage
.
HeartBeat
(
now
))
}
}
handler
.
postDelayed
(
::
start
,
DELAY
)
handler
.
postDelayed
(
::
start
,
DELAY
)
...
@@ -40,7 +42,7 @@ class AndroidHeartBeatRunner(
...
@@ -40,7 +42,7 @@ class AndroidHeartBeatRunner(
}
}
companion
object
{
companion
object
{
const
val
TIMEOUT
=
12
0_000L
const
val
TIMEOUT
=
9
0_000L
const
val
DELAY
=
30_000L
const
val
DELAY
=
30_000L
}
}
}
}
This diff is collapsed.
Click to expand it.
Shane Synan
@digitalcircuit
mentioned in issue
#129 (closed)
·
6 years ago
mentioned in issue
#129 (closed)
mentioned in issue #129
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment