diff options
author | Antoine A <> | 2024-03-12 23:03:02 +0100 |
---|---|---|
committer | Antoine A <> | 2024-03-13 21:19:30 +0100 |
commit | 651217a5c089bd20d94f9b4760e13f491bc26861 (patch) | |
tree | 4a8168faeba67b6bf5402edbbc288ad7c129640e /nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt | |
parent | cd6421f1c45e1a51415c19c1e28eed8a91c56008 (diff) | |
download | libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.tar.gz libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.tar.bz2 libeufin-651217a5c089bd20d94f9b4760e13f491bc26861.zip |
Improve submission order to guarantee progress and improve testbench
Diffstat (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt')
-rw-r--r-- | nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt index 656ce694..8366f064 100644 --- a/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt +++ b/nexus/src/main/kotlin/tech/libeufin/nexus/EbicsSubmit.kt @@ -110,7 +110,7 @@ private suspend fun submitBatch( ctx: SubmissionContext, db: Database, ) { - db.initiated.submittableGet(ctx.cfg.currency).forEach { + db.initiated.submittable(ctx.cfg.currency).forEach { logger.debug("Submitting payment '${it.requestUid}'") runCatching { submitInitiatedPayment(ctx, it) }.fold( onSuccess = { orderId -> @@ -119,7 +119,7 @@ private suspend fun submitBatch( }, onFailure = { e -> db.initiated.submissionFailure(it.id, Instant.now(), e.message) - logger.warn("Payment '${it.requestUid}' submission failure: ${e.message}") + logger.error("Payment '${it.requestUid}' submission failure: ${e.fmt()}") throw e } ) @@ -175,7 +175,7 @@ class EbicsSubmit : CliktCommand("Submits any initiated payment found in the dat try { submitBatch(ctx, db) } catch (e: Exception) { - throw Exception("Failed to submit payments", e) + throw Exception("Failed to submit payments") } // TODO take submitBatch taken time in the delay delay(((frequency?.inSeconds ?: 0) * 1000).toLong()) |