fun update()

in server/src/main/kotlin/com/jetbrains/teamcity/plugins/unrealengine/server/build/state/DistributedBuildStateStorage.kt [34:58]


    fun update(
        build: SBuild,
        steps: Sequence<DistributedBuildState.BuildStep>,
    ): DistributedBuildState {
        val state = get(build)

        val propertiesToUpdate =
            steps
                .flatMap {
                    val (buildIndex, stepIndex) =
                        state
                            .locateBuildStep(it.name)
                            .let { location ->
                                ensureNotNull(location, "There is no step named ${it.name} within a build ${build.buildId}")
                            }

                    properties
                        .encodeToStringMap(it)
                        .mapKeys { (key, _) -> formatStepKeyWithinBuild(key, buildIndex, stepIndex) }
                        .entries
                }.associate { it.toPair() }

        build.buildStateStorage.updateValues(propertiesToUpdate, emptySet())
        return get(build)
    }