feat: media-mirror-worker — воркер конвертации зеркал (очередь Postgres, ядро из media-transformer)
- очередь: jobs в схеме media_mirror, SELECT ... FOR UPDATE SKIP LOCKED, stale-возврат - ядро перенесено из media-transformer (FfmpegService, FfprobeService, JellyfinInput, S3Input, OutputService...) - Spring Boot 4.1.0, Kotlin 2.4.10, kotlinx-serialization 1.11.0, NATS выпилен - тесты: 45 (SKIP LOCKED параллельный, конец-в-конец до done, конвертация 480p+2 аудио), LINE 93%
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "2.4.10"
|
||||
kotlin("plugin.serialization") version "2.4.10"
|
||||
id("org.springframework.boot") version "4.1.0"
|
||||
jacoco
|
||||
}
|
||||
|
||||
group = "pw.binom.mirror.worker"
|
||||
version = "1.0.0-SNAPSHOT"
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = JvmTarget.JVM_21
|
||||
freeCompilerArgs.add("-Xjsr305=strict")
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
named("runtimeClasspath") {
|
||||
exclude(group = "tools.jackson.core")
|
||||
exclude(group = "tools.jackson.databind")
|
||||
exclude(group = "com.fasterxml.jackson.core")
|
||||
exclude(group = "com.fasterxml.jackson.databind")
|
||||
exclude(group = "com.fasterxml.jackson.datatype")
|
||||
exclude(group = "com.fasterxml.jackson.dataformat")
|
||||
exclude(group = "com.fasterxml.jackson.module")
|
||||
}
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
force("org.testcontainers:testcontainers:1.21.4")
|
||||
force("org.testcontainers:junit-jupiter:1.21.4")
|
||||
force("org.testcontainers:postgresql:1.21.4")
|
||||
force("org.testcontainers:minio:1.21.4")
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("org.springframework.boot:spring-boot-dependencies:4.1.0"))
|
||||
implementation("org.springframework.boot:spring-boot-starter-webmvc")
|
||||
implementation("org.springframework.boot:spring-boot-starter-jdbc")
|
||||
implementation("org.springframework.boot:spring-boot-starter-flyway")
|
||||
implementation("org.flywaydb:flyway-database-postgresql")
|
||||
implementation("org.postgresql:postgresql")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0")
|
||||
implementation(platform("software.amazon.awssdk:bom:2.46.21"))
|
||||
implementation("software.amazon.awssdk:s3")
|
||||
|
||||
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||
testImplementation(kotlin("test-junit5"))
|
||||
testImplementation("org.testcontainers:testcontainers:1.21.4")
|
||||
testImplementation("org.testcontainers:junit-jupiter:1.21.4")
|
||||
testImplementation("org.testcontainers:postgresql:1.21.4")
|
||||
testImplementation("org.testcontainers:minio:1.21.4")
|
||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2")
|
||||
}
|
||||
|
||||
springBoot {
|
||||
mainClass = "pw.binom.mirror.worker.WorkerApplication"
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
useJUnitPlatform()
|
||||
maxParallelForks = 1
|
||||
testLogging {
|
||||
showStandardStreams = true
|
||||
events("passed", "failed", "skipped")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<Jar> {
|
||||
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
|
||||
}
|
||||
|
||||
tasks.jacocoTestReport {
|
||||
dependsOn(tasks.test)
|
||||
reports {
|
||||
xml.required.set(true)
|
||||
html.required.set(true)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.jacocoTestCoverageVerification {
|
||||
dependsOn(tasks.jacocoTestReport)
|
||||
violationRules {
|
||||
rule {
|
||||
element = "PACKAGE"
|
||||
includes = listOf("pw.binom.mirror.worker.convert")
|
||||
limit {
|
||||
counter = "LINE"
|
||||
value = "COVEREDRATIO"
|
||||
minimum = "0.80".toBigDecimal()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.check {
|
||||
dependsOn(tasks.jacocoTestReport, tasks.jacocoTestCoverageVerification)
|
||||
}
|
||||
Reference in New Issue
Block a user