Ещё чистка

This commit is contained in:
2026-04-18 22:47:49 +03:00
parent 047eaa2f59
commit 586e2b61fd
21 changed files with 17 additions and 59 deletions

View File

@@ -2,7 +2,6 @@ package com.github.nullptroma.wallenc.data.db.app.model
import androidx.room.ColumnInfo
import androidx.room.Entity
import com.github.nullptroma.wallenc.data.db.app.repository.StorageKeyMapRepository
import com.github.nullptroma.wallenc.data.model.StorageKeyMap
import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
import java.util.UUID

View File

@@ -3,7 +3,6 @@ package com.github.nullptroma.wallenc.data.db.app.model
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.github.nullptroma.wallenc.domain.common.impl.CommonStorageMetaInfo
import java.util.UUID
@Entity(tableName = "storage_meta_infos")

View File

@@ -1,6 +1,5 @@
package com.github.nullptroma.wallenc.data.model
import androidx.room.ColumnInfo
import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
import java.util.UUID

View File

@@ -1,7 +1,6 @@
package com.github.nullptroma.wallenc.data.storages.encrypt
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.github.nullptroma.wallenc.data.db.app.repository.StorageMetaInfoRepository
import com.github.nullptroma.wallenc.domain.common.impl.CommonStorageMetaInfo
import com.github.nullptroma.wallenc.domain.datatypes.EncryptKey
import com.github.nullptroma.wallenc.domain.datatypes.StorageEncryptionInfo
@@ -13,15 +12,14 @@ import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DisposableHandle
import kotlinx.coroutines.Job
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.withContext
import java.io.InputStream
import java.util.UUID
import kotlin.coroutines.coroutineContext
class EncryptedStorage private constructor(
private val source: IStorage,

View File

@@ -1,6 +1,5 @@
package com.github.nullptroma.wallenc.data.storages.encrypt
import com.github.nullptroma.wallenc.data.utils.CloseHandledStreamExtension.Companion.onClosed
import com.github.nullptroma.wallenc.data.utils.CloseHandledStreamExtension.Companion.onClosing
import com.github.nullptroma.wallenc.domain.common.impl.CommonDirectory
import com.github.nullptroma.wallenc.domain.common.impl.CommonFile

View File

@@ -15,7 +15,6 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.withContext
import java.io.InputStream
import kotlin.coroutines.coroutineContext
import java.util.UUID

View File

@@ -13,15 +13,17 @@ import com.github.nullptroma.wallenc.domain.tasks.TaskProgress
import com.github.nullptroma.wallenc.domain.tasks.TaskRunState
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.withContext
import java.util.Collections
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicReference
@@ -77,16 +79,18 @@ class TaskOrchestrator(
}
emitState(id)
val job = Job(pipelineSupervisor)
currentRunJob.set(job)
val ctx = TaskContextImpl(
taskId = id,
onRunningProgress = { p -> onRunningProgress(id, envelope.title, envelope.requiresForeground, p) },
appendLog = { level, msg -> appendLogLine(level, msg) },
)
try {
withContext(ioDispatcher + job) {
envelope.work.run(ctx)
coroutineScope {
val runJob: Deferred<Unit> = async(ioDispatcher) {
envelope.work.run(ctx)
}
currentRunJob.set(runJob)
runJob.await()
}
replaceTask(id) { it.copy(state = TaskRunState.Completed) }
cancelRequested.remove(id)