Updated check
This commit is contained in:
parent
2020022b13
commit
423c6707e9
@ -39,7 +39,6 @@ class FfmpegRunner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun run(progress: Boolean = false) {
|
fun run(progress: Boolean = false) {
|
||||||
log.info { "Starting ffmpeg on file $inputFile" }
|
|
||||||
val args = FfmpegArgumentsBuilder()
|
val args = FfmpegArgumentsBuilder()
|
||||||
.inputFile(inputFile)
|
.inputFile(inputFile)
|
||||||
.outputFile(outputFile)
|
.outputFile(outputFile)
|
||||||
@ -47,6 +46,8 @@ class FfmpegRunner(
|
|||||||
.allowOverwrite(ProcesserEnv.allowOverwrite)
|
.allowOverwrite(ProcesserEnv.allowOverwrite)
|
||||||
.withProgress(progress)
|
.withProgress(progress)
|
||||||
.build()
|
.build()
|
||||||
|
log.info { "Starting ffmpeg on file $inputFile with arguments:\n\t ${args.joinToString(" ")}" }
|
||||||
|
|
||||||
job = scope.launch {
|
job = scope.launch {
|
||||||
execute(args)
|
execute(args)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,12 +106,6 @@ class PersistentEventManager(private val dataSource: DataSource) {
|
|||||||
|
|
||||||
//region Database write
|
//region Database write
|
||||||
|
|
||||||
val digest = MessageDigest.getInstance("MD5")
|
|
||||||
@OptIn(ExperimentalStdlibApi::class)
|
|
||||||
private fun getIntegrityOfData(data : String) : String {
|
|
||||||
return digest.digest(data.toByteArray(kotlin.text.Charsets.UTF_8))
|
|
||||||
.toHexString()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the kafka event and its data in the database as PersistentMessage
|
* Stores the kafka event and its data in the database as PersistentMessage
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import no.iktdev.mediaprocessing.shared.kafka.dto.Status
|
|||||||
import org.jetbrains.exposed.sql.*
|
import org.jetbrains.exposed.sql.*
|
||||||
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||||
import org.jetbrains.exposed.sql.javatime.CurrentDateTime
|
import org.jetbrains.exposed.sql.javatime.CurrentDateTime
|
||||||
|
import java.security.MessageDigest
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
class TasksManager(private val dataSource: DataSource) {
|
class TasksManager(private val dataSource: DataSource) {
|
||||||
@ -128,12 +129,20 @@ class TasksManager(private val dataSource: DataSource) {
|
|||||||
it[tasks.eventId] = eventId
|
it[tasks.eventId] = eventId
|
||||||
it[tasks.task] = task.name
|
it[tasks.task] = task.name
|
||||||
it[tasks.data] = data
|
it[tasks.data] = data
|
||||||
|
it[tasks.integrity] = getIntegrityOfData(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val digest = MessageDigest.getInstance("MD5")
|
||||||
|
@OptIn(ExperimentalStdlibApi::class)
|
||||||
|
private fun getIntegrityOfData(data : String) : String {
|
||||||
|
return digest.digest(data.toByteArray(kotlin.text.Charsets.UTF_8))
|
||||||
|
.toHexString()
|
||||||
|
}
|
||||||
|
|
||||||
fun Query?.toTaskTypeGroup(): Map<TaskType, List<Task>> {
|
fun Query?.toTaskTypeGroup(): Map<TaskType, List<Task>> {
|
||||||
val dz = TaskDoz()
|
val dz = TaskDoz()
|
||||||
val res = this?.mapNotNull { dz.deserializeTask(it) }?.groupBy { it.task } ?: emptyMap()
|
val res = this?.mapNotNull { dz.deserializeTask(it) }?.groupBy { it.task } ?: emptyMap()
|
||||||
|
|||||||
@ -17,8 +17,9 @@ object tasks: IntIdTable() {
|
|||||||
val data: Column<String> = text("data")
|
val data: Column<String> = text("data")
|
||||||
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime)
|
val created: Column<LocalDateTime> = datetime("created").defaultExpression(CurrentDateTime)
|
||||||
val lastCheckIn: Column<LocalDateTime?> = datetime("lastCheckIn").nullable()
|
val lastCheckIn: Column<LocalDateTime?> = datetime("lastCheckIn").nullable()
|
||||||
|
val integrity: Column<String> = varchar("integrity", 100)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
uniqueIndex(referenceId, eventId, task)
|
uniqueIndex(referenceId, task, integrity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user