Skip to content

Commit

Permalink
Fix idle changed duration
Browse files Browse the repository at this point in the history
  • Loading branch information
2e3s committed May 17, 2024
1 parent 0434aa1 commit f001121
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions watchers/src/watchers/idle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ impl State {
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 {
let result = if self.is_idle {
debug!("Reporting as changed to idle");
Expand All @@ -82,7 +86,7 @@ impl State {
.ping(
true,
self.last_input_time + Duration::milliseconds(1),
Duration::zero(),
now - self.last_input_time,
)
.await
} else {
Expand Down

0 comments on commit f001121

Please sign in to comment.