Skip to content

Commit

Permalink
Merge pull request #35 from SergKhram/bugfix/fixed-parallel-execution
Browse files Browse the repository at this point in the history
Fixed parallel execution
  • Loading branch information
SergKhram authored Jun 18, 2021
2 parents d2e64ea + e3eef7f commit d286641
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.net.URI

group = "io.github.sergkhram"
version = "1.1.2-RELEASE"
version = "1.1.3-RELEASE"

dependencies {
implementation("com.fasterxml.jackson.core:jackson-databind:2.12.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import kotlinx.coroutines.newFixedThreadPoolContext
import kotlinx.coroutines.runBlocking
import java.io.File
import kotlin.math.roundToInt
import java.util.concurrent.ConcurrentHashMap

class CleanAllureEnrichService(
private val mapper: ObjectMapper,
private val projectDirectory: String
) : EnrichService {
val devicesInfo = mutableMapOf<String, DeviceInfo?>()
val devicesInfo = ConcurrentHashMap<String, DeviceInfo?>()

override fun iterableEnrich() {
logger.info("Getting results from device")
Expand All @@ -42,7 +43,7 @@ class CleanAllureEnrichService(
filteredDevices.forEach {
val model = adb.getModel(it.serial)
val osVersion = adb.getOsVersion(it.serial)
devicesInfo.put(it.serial, if(!model.isNullOrBlank() && !osVersion.isNullOrBlank()) DeviceInfo(model, osVersion) else null)
devicesInfo[it.serial] = if(!model.isNullOrBlank() && !osVersion.isNullOrBlank()) DeviceInfo(model, osVersion) else null
}
filteredDevices.forEach { device ->
transferringFilesByDevice(this, adb, device)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import kotlinx.coroutines.newFixedThreadPoolContext
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeoutOrNull
import java.io.File
import java.util.concurrent.ConcurrentHashMap

class MarathonEnrichService(
private val marathonAllureResDirectory: File,
private val mapper: ObjectMapper,
private val projectDirectory: String,
private val allureDeviceResDirectory: File
) : EnrichService {
val devicesInfo = mutableMapOf<String, DeviceInfo?>()
val devicesInfo = ConcurrentHashMap<String, DeviceInfo?>()

override fun iterableEnrich() {
logger.info("Getting results from Marathon")
Expand Down Expand Up @@ -162,7 +163,7 @@ class MarathonEnrichService(
logger.debug(e.message ?: e.localizedMessage)
}
}
devicesInfo.put(serial, deviceInfo)
devicesInfo[serial] = deviceInfo
}
}
}

0 comments on commit d286641

Please sign in to comment.