Skip to content

Commit cdb2826

Browse files
committed
Only send heartbeat when phone is not already dead
1 parent 99640fd commit cdb2826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/pkg/services/heartbeat_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ func (service *HeartbeatService) Monitor(ctx context.Context, params *HeartbeatM
303303
}
304304

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

0 commit comments

Comments
 (0)