mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Only query service outage every 60 seconds, even if not reachable.
This commit is contained in:
committed by
mtang-signal
parent
a76d400bd1
commit
a3c476f2ab
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user