Commit 1c41c300 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Don't enable sentry for mars-sandbox

There were a lot of events (1k+) from this host, looks like it might be some sort of automated environment
parent 8b9217ec
......@@ -22,6 +22,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import leakcanary.LeakSentry
import java.net.InetAddress
import java.util.*
import kotlin.system.exitProcess
......@@ -97,6 +98,8 @@ class SmokeScreen : Application() {
fun initSentry(forceStatus: Status = Status.NONE) {
if (!BuildConfig.DEBUG && BuildConfig.SENTRY_DSN != "dummy") {
GlobalScope.launch(Dispatchers.IO) {
val hostName = InetAddress.getLocalHost().hostName
if(!hostName.startsWith("mars-sandbox", true)) {
val enabledType = getPreferences().crashreportingType
if (forceStatus != Status.DATASAVING && (enabledType == Crashreporting.FULL || forceStatus == Status.ENABLED)) {
// Enable Sentry in full mode
......@@ -154,6 +157,7 @@ class SmokeScreen : Application() {
}
}
}
}
override fun onLowMemory() {
super.onLowMemory()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment