Skip to content

Commit

Permalink
Only send heartbeat when phone is not already dead
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Oct 20, 2024
1 parent 99640fd commit cdb2826
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/pkg/services/heartbeat_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (service *HeartbeatService) Monitor(ctx context.Context, params *HeartbeatM
}

if time.Now().UTC().Sub(heartbeat.Timestamp) > (heartbeatCheckInterval*4) &&
time.Now().UTC().Sub(heartbeat.Timestamp) < (heartbeatCheckInterval*5) {
time.Now().UTC().Sub(heartbeat.Timestamp) < (heartbeatCheckInterval*5) && !monitor.PhoneIsOffline() {
return service.handleFailedMonitor(ctx, heartbeat.Timestamp, params)
}

Expand Down

0 comments on commit cdb2826

Please sign in to comment.