Only query service outage every 60 seconds, even if not reachable.

This commit is contained in:
Nicholas Tinsley
2024-08-21 16:13:50 -04:00
committed by mtang-signal
parent a76d400bd1
commit a3c476f2ab

View File

@@ -76,11 +76,11 @@ class ServiceOutageObserver(private val context: Context) : DefaultLifecycleObse
private suspend fun queryAvailability(): Result = withContext(Dispatchers.IO) {
try {
val address = InetAddress.getByName(BuildConfig.SIGNAL_SERVICE_STATUS_URL)
val now = System.currentTimeMillis()
TextSecurePreferences.setLastOutageCheckTime(context, now)
val address = InetAddress.getByName(BuildConfig.SIGNAL_SERVICE_STATUS_URL)
if (ServiceOutageDetectionJob.IP_SUCCESS == address.hostAddress) {
Result.SUCCESS
} else if (ServiceOutageDetectionJob.IP_FAILURE == address.hostAddress) {