diff --git a/backend/src/main/kotlin/dev/dres/api/cli/EvaluationTemplateCommand.kt b/backend/src/main/kotlin/dev/dres/api/cli/EvaluationTemplateCommand.kt index f8e56f85..749726d2 100644 --- a/backend/src/main/kotlin/dev/dres/api/cli/EvaluationTemplateCommand.kt +++ b/backend/src/main/kotlin/dev/dres/api/cli/EvaluationTemplateCommand.kt @@ -58,7 +58,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * [CliktCommand] to create a new [DbEvaluationTemplate]. */ - inner class Create : CliktCommand(name = "create", help = "Creates a new Template") { + inner class Create : CliktCommand( + name = "create", + help = "Creates a new Template", + printHelpOnEmptyArgs = true + ) { private val name: String by option("-t", "--template", help = "Name of the new Template") .required() @@ -77,7 +81,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * [CliktCommand] to delete a [DbEvaluationTemplate]. */ - inner class Delete : CliktCommand(name = "delete", help = "Deletes a template", printHelpOnEmptyArgs = true) { + inner class Delete : CliktCommand( + name = "delete", + help = "Deletes a template", + printHelpOnEmptyArgs = true + ) { private val id: String by option("-i", "--id").required() .validate { require(it.isNotEmpty()) { "Id must be non empty." } } @@ -96,7 +104,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * [CliktCommand] to copy a [DbEvaluationTemplate]. */ - inner class Copy : CliktCommand(name = "copy", help = "Copies a Template", printHelpOnEmptyArgs = true) { + inner class Copy : CliktCommand( + name = "copy", + help = "Copies a Template", + printHelpOnEmptyArgs = true + ) { private val id: String by option("-i", "--id").required() .validate { require(it.isNotEmpty()) { "Id must be non empty." } } @@ -116,7 +128,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * [CliktCommand] to rename a [DbEvaluationTemplate]. */ - inner class Rename : CliktCommand(name = "rename", help = "Renames a Template") { + inner class Rename : CliktCommand( + name = "rename", + help = "Renames a Template", + printHelpOnEmptyArgs = true + ) { private val id: String by option("-i", "--id").required() .validate { require(it.isNotEmpty()) { "Id must be non empty." } } @@ -148,6 +164,7 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : inner class List : CliktCommand(name = "list", help = "Lists an overview of all Templates") { override fun run() { var no = 0 + println() println(table { cellStyle { border = true @@ -202,7 +219,8 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : */ inner class Prepare : CliktCommand( name = "prepare", - help = "Checks the used media items and generates precomputed previews." + help = "Checks the used media items and generates precomputed previews.", + printHelpOnEmptyArgs = true ) { private val id: String by option("-i", "--id").required() @@ -224,7 +242,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * Exports a specific evaluation to a JSON file. */ - inner class Export : CliktCommand(name = "export", help = "Exports a template as JSON.") { + inner class Export : CliktCommand( + name = "export", + help = "Exports a template as JSON.", + printHelpOnEmptyArgs = true + ) { /** Path to the file that should be created .*/ private val path: Path by option("-o", "--out", help = "The destination file for the template.").path() @@ -266,7 +288,11 @@ class EvaluationTemplateCommand(private val cache: CacheManager) : /** * Imports a template from a JSON file. */ - inner class Import : CliktCommand(name = "import", help = "Imports a template from JSON.") { + inner class Import : CliktCommand( + name = "import", + help = "Imports a template from JSON.", + printHelpOnEmptyArgs = true + ) { /** Path to the file that should be imported.*/ private val path: Path by option("-i", "--in", help = "The file to import the template from.").path().required() diff --git a/backend/src/main/kotlin/dev/dres/mgmt/TemplateManager.kt b/backend/src/main/kotlin/dev/dres/mgmt/TemplateManager.kt index c63b4e3e..c8687291 100644 --- a/backend/src/main/kotlin/dev/dres/mgmt/TemplateManager.kt +++ b/backend/src/main/kotlin/dev/dres/mgmt/TemplateManager.kt @@ -386,12 +386,16 @@ object TemplateManager { } } } + + println("start rendering ${segmentTasks.size} videos") + await.all { try { - it.get(60, TimeUnit.SECONDS) + val result = it.get(3, TimeUnit.MINUTES) + println("completed rendering of $result") true } catch (e: Throwable) { - throw IllegalStateException("Required media file could not be prepared.") + throw IllegalStateException("Required media file could not be prepared: ${e.message}") } }