diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2018-02-12 14:26:44 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2018-02-12 14:29:39 +0100 |
| commit | e97d9bf3f2cccf19a21631e26d55d60c9f4d7c7a (patch) | |
| tree | 518a0924578d12394f6117a416ac7787f729be63 /opendc-model-odc/setup/src/main/kotlin | |
| parent | 67c8bc6cdd421262c4f59ce03506463a830af6e6 (diff) | |
refactor(#18): Align formatting with official Kotlin Style Guide
This change aligns the code formatting of the project with the official
Kotlin Style Guide. They can be found at
http://kotlinlang.org/docs/reference/coding-conventions.html.
Diffstat (limited to 'opendc-model-odc/setup/src/main/kotlin')
| -rw-r--r-- | opendc-model-odc/setup/src/main/kotlin/platform/JpaPlatformRunner.kt | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/opendc-model-odc/setup/src/main/kotlin/platform/JpaPlatformRunner.kt b/opendc-model-odc/setup/src/main/kotlin/platform/JpaPlatformRunner.kt index 3f0fe589..8fe49844 100644 --- a/opendc-model-odc/setup/src/main/kotlin/platform/JpaPlatformRunner.kt +++ b/opendc-model-odc/setup/src/main/kotlin/platform/JpaPlatformRunner.kt @@ -39,28 +39,28 @@ val logger = KotlinLogging.logger {} * @param args The command line arguments of the program. */ fun main(args: Array<String>) { - val properties = HashMap<Any, Any>() - val env = System.getenv() - properties["javax.persistence.jdbc.url"] = env["PERSISTENCE_URL"] ?: "" - properties["javax.persistence.jdbc.user"] = env["PERSISTENCE_USER"] ?: "" - properties["javax.persistence.jdbc.password"] = env["PERSISTENCE_PASSWORD"] ?: "" - val factory = Persistence.createEntityManagerFactory("opendc-simulator", properties) + val properties = HashMap<Any, Any>() + val env = System.getenv() + properties["javax.persistence.jdbc.url"] = env["PERSISTENCE_URL"] ?: "" + properties["javax.persistence.jdbc.user"] = env["PERSISTENCE_USER"] ?: "" + properties["javax.persistence.jdbc.password"] = env["PERSISTENCE_PASSWORD"] ?: "" + val factory = Persistence.createEntityManagerFactory("opendc-simulator", properties) - val timeout = 10000L - val threads = 4 - val executorService = Executors.newFixedThreadPool(threads) - val experiments = JpaExperimentManager(factory) - val kernel = OmegaKernelFactory + val timeout = 10000L + val threads = 4 + val executorService = Executors.newFixedThreadPool(threads) + val experiments = JpaExperimentManager(factory) + val kernel = OmegaKernelFactory - logger.info { "Waiting for enqueued experiments..." } - while (true) { - experiments.poll()?.let { experiment -> - logger.info { "Found experiment. Submitting for simulation now..." } - executorService.submit { - experiment.use { it.run(kernel, timeout) } - } - } + logger.info { "Waiting for enqueued experiments..." } + while (true) { + experiments.poll()?.let { experiment -> + logger.info { "Found experiment. Submitting for simulation now..." } + executorService.submit { + experiment.use { it.run(kernel, timeout) } + } + } - Thread.sleep(500) - } + Thread.sleep(500) + } } |
