mirror of
https://github.com/2e3s/awatcher.git
synced 2025-06-05 19:15:33 +00:00
Fix idle changed duration
This commit is contained in:
parent
0434aa103b
commit
f001121d69
@ -69,7 +69,11 @@ impl State {
|
|||||||
self.send_ping(now, client).await
|
self.send_ping(now, client).await
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_ping(&mut self, now: DateTime<Utc>, client: &Arc<ReportClient>) -> anyhow::Result<()> {
|
async fn send_ping(
|
||||||
|
&mut self,
|
||||||
|
now: DateTime<Utc>,
|
||||||
|
client: &Arc<ReportClient>,
|
||||||
|
) -> anyhow::Result<()> {
|
||||||
if self.is_changed {
|
if self.is_changed {
|
||||||
let result = if self.is_idle {
|
let result = if self.is_idle {
|
||||||
debug!("Reporting as changed to idle");
|
debug!("Reporting as changed to idle");
|
||||||
@ -82,7 +86,7 @@ impl State {
|
|||||||
.ping(
|
.ping(
|
||||||
true,
|
true,
|
||||||
self.last_input_time + Duration::milliseconds(1),
|
self.last_input_time + Duration::milliseconds(1),
|
||||||
Duration::zero(),
|
now - self.last_input_time,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user