NOTICK - make recordDependencies suspendable (#6896)

* add suspendable annotation to recordDependencies

* add suspendable annotation to recordDependencies implementation
This commit is contained in:
Agnieszka Szczepanska 2021-04-14 09:30:53 +02:00 committed by GitHub
parent 360b3f8d0c
commit 8dd9dee9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -24,5 +24,6 @@ interface TransactionsResolver {
@Suspendable @Suspendable
fun downloadDependencies(batchMode: Boolean) fun downloadDependencies(batchMode: Boolean)
@Suspendable
fun recordDependencies(usedStatesToRecord: StatesToRecord) fun recordDependencies(usedStatesToRecord: StatesToRecord)
} }

View File

@ -94,6 +94,7 @@ class DbTransactionsResolver(private val flow: ResolveTransactionsFlow) : Transa
logger.debug { "Downloaded ${sortedDependencies?.size} dependencies from remote peer for transactions ${flow.txHashes}" } logger.debug { "Downloaded ${sortedDependencies?.size} dependencies from remote peer for transactions ${flow.txHashes}" }
} }
@Suspendable
override fun recordDependencies(usedStatesToRecord: StatesToRecord) { override fun recordDependencies(usedStatesToRecord: StatesToRecord) {
val sortedDependencies = checkNotNull(this.sortedDependencies) val sortedDependencies = checkNotNull(this.sortedDependencies)
logger.trace { "Recording ${sortedDependencies.size} dependencies for ${flow.txHashes.size} transactions" } logger.trace { "Recording ${sortedDependencies.size} dependencies for ${flow.txHashes.size} transactions" }