Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Only send heartbeat when phone is not already dead

Acho Arnoldcdb28264a1fe
diff --git a/api/pkg/services/heartbeat_service.go b/api/pkg/services/heartbeat_service.go
index 3480e6a8..811a3d97 100644
--- a/api/pkg/services/heartbeat_service.go
+++ b/api/pkg/services/heartbeat_service.go
@@ -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)
}