diff options
author | MS <ms@taler.net> | 2023-04-16 21:30:10 +0200 |
---|---|---|
committer | MS <ms@taler.net> | 2023-04-16 21:30:10 +0200 |
commit | cdee48b0fceed6256cd22eafbe03c581f49a9211 (patch) | |
tree | 1d380697793477157db3ae06e7acc4aae6059f4c /sandbox/src/main/kotlin/tech/libeufin | |
parent | e61a4d09d9721594a3d0b6275cbe880ae9de208f (diff) | |
download | libeufin-cdee48b0fceed6256cd22eafbe03c581f49a9211.tar.gz libeufin-cdee48b0fceed6256cd22eafbe03c581f49a9211.tar.bz2 libeufin-cdee48b0fceed6256cd22eafbe03c581f49a9211.zip |
renaming function argument
Diffstat (limited to 'sandbox/src/main/kotlin/tech/libeufin')
-rw-r--r-- | sandbox/src/main/kotlin/tech/libeufin/sandbox/ConversionService.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/ConversionService.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/ConversionService.kt index 4045d10e..c52d74dd 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/ConversionService.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/ConversionService.kt @@ -6,7 +6,6 @@ import io.ktor.client.plugins.* import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* -import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking import org.jetbrains.exposed.sql.and @@ -103,22 +102,23 @@ private fun getUnsubmittedTransactions(bankAccountLabel: String): List<BankAccou /** * This function listens for regio-incoming events (LIBEUFIN_REGIO_TX) - * and submits the related cash-out payment to Nexus. The fiat payment will - * then take place ENTIRELY on Nexus' responsibility. + * on the 'watchedBankAccount' and submits the related cash-out payment + * to Nexus. The fiat payment will then take place ENTIRELY on Nexus' + * responsibility. */ suspend fun cashoutMonitor( httpClient: HttpClient, - bankAccountLabel: String = "admin", + watchedBankAccount: String = "admin", demobankName: String = "default" // used to get config values. ) { // Register for a REGIO_TX event. val eventChannel = buildChannelName( NotificationsChannelDomains.LIBEUFIN_REGIO_TX, - bankAccountLabel + watchedBankAccount ) val objectMapper = jacksonObjectMapper() val demobank = getDemobank(demobankName) - val bankAccount = getBankAccountFromLabel(bankAccountLabel) + val bankAccount = getBankAccountFromLabel(watchedBankAccount) val config = demobank?.config ?: throw internalServerError( "Demobank '$demobankName' has no configuration." ) @@ -146,7 +146,7 @@ suspend fun cashoutMonitor( listenHandle.postgresListen() // but optimistically check for data, case some // arrived _before_ the LISTEN. - var newTxs = getUnsubmittedTransactions(bankAccountLabel) + var newTxs = getUnsubmittedTransactions(watchedBankAccount) // Data found, UNLISTEN. if (newTxs.isNotEmpty()) listenHandle.postgresUnlisten() @@ -158,7 +158,7 @@ suspend fun cashoutMonitor( // HTTP server. val isNotificationArrived = listenHandle.postgresGetNotifications(waitTimeout) if (isNotificationArrived && listenHandle.receivedPayload == "CRDT") - newTxs = getUnsubmittedTransactions(bankAccountLabel) + newTxs = getUnsubmittedTransactions(watchedBankAccount) } if (newTxs.isEmpty()) continue |