KT-48620: Fix host name exception
This commit is contained in:
+8
-1
@@ -32,7 +32,14 @@ class KotlinBuildEsStatListener(val projectName: String, val reportStatistics: L
|
||||
OperationCompletionListener, AutoCloseable, TaskExecutionListener {
|
||||
|
||||
val label by lazy { CompilerSystemProperties.KOTLIN_STAT_LABEl_PROPERTY.value }
|
||||
val hostName by lazy { InetAddress.getLocalHost().hostName }
|
||||
val hostName: String? by lazy {
|
||||
try {
|
||||
InetAddress.getLocalHost().hostName
|
||||
} catch (_: Exception) {
|
||||
//do nothing
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinish(event: FinishEvent?) {
|
||||
if (event is TaskFinishEvent) {
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ data class CompileStatData(
|
||||
val changes: List<String>,
|
||||
val buildUuid: String = "Unset",
|
||||
val kotlinVersion: String = "0.0.0",
|
||||
val hostName: String = "Unset",
|
||||
val hostName: String? = "Unset",
|
||||
val timeInMillis: Long,
|
||||
val nonIncrementalAttributes: Map<BuildAttribute, Int>,
|
||||
val timeData: Map<BuildTime, Long>,
|
||||
|
||||
Reference in New Issue
Block a user