[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: make sure task scheduler is executed
From: |
gnunet |
Subject: |
[libeufin] branch master updated: make sure task scheduler is executed |
Date: |
Sat, 07 Aug 2021 13:53:35 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 7185215 make sure task scheduler is executed
7185215 is described below
commit 7185215e9e3578127afd95a190ec4290ee591589
Author: Florian Dold <florian@dold.me>
AuthorDate: Sat Aug 7 13:53:30 2021 +0200
make sure task scheduler is executed
---
cli/bin/libeufin-cli | 8 ++++----
nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 7 +++++--
nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt | 1 +
nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 5 +----
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/cli/bin/libeufin-cli b/cli/bin/libeufin-cli
index b827a78..0370344 100755
--- a/cli/bin/libeufin-cli
+++ b/cli/bin/libeufin-cli
@@ -802,7 +802,7 @@ def show_payment(obj, account_name, payment_uuid):
@accounts.command(help="List payment initiations")
@click.argument("account-name")
@click.pass_obj
-def show_payment(obj, account_name):
+def list_payments(obj, account_name):
url = urljoin(
obj.nexus_base_url,
f"/bank-accounts/{account_name}/payment-initiations"
)
@@ -813,7 +813,7 @@ def show_payment(obj, account_name):
exit(1)
tell_user(
- resp,
+ resp, withsuccess=True,
)
check_response_status(resp)
@@ -822,7 +822,7 @@ def show_payment(obj, account_name):
@click.argument("account-name")
@click.option("--payment-uuid", help="payment unique identifier",
required=True)
@click.pass_obj
-def show_payment(obj, account_name, payment_uuid):
+def delete_payment(obj, account_name, payment_uuid):
url = urljoin(
obj.nexus_base_url,
f"/bank-accounts/{account_name}/payment-initiations/{payment_uuid}",
@@ -864,7 +864,7 @@ def fetch_transactions(obj, account_name, range_type,
level):
check_response_status(resp)
-@accounts.command(help="get transactions from the simplified nexus JSON API")
+@accounts.command(help="Get transactions from the simplified nexus JSON API")
@click.option(
"--compact/--no-compact",
help="Tells only amount/subject for each payment",
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 4927b10..c950885 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -34,7 +34,6 @@ import com.github.ajalt.clikt.parameters.types.int
import execThrowableOrTerminate
import com.github.ajalt.clikt.core.*
import com.github.ajalt.clikt.parameters.options.versionOption
-import io.ktor.client.*
import tech.libeufin.nexus.iso20022.parseCamtMessage
import tech.libeufin.nexus.server.client
import tech.libeufin.util.*
@@ -61,8 +60,12 @@ class Serve : CliktCommand("Run nexus HTTP server") {
private val logLevel by option()
override fun run() {
setLogLevel(logLevel)
- serverMain(getDbConnFromEnv(NEXUS_DB_ENV_VAR_NAME), host, port)
+ val dbConn = getDbConnFromEnv(NEXUS_DB_ENV_VAR_NAME)
+ execThrowableOrTerminate {
+ dbCreateTables(dbConn)
+ }
startOperationScheduler(client)
+ serverMain(host, port)
}
}
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt
index 7e87c5a..8528753 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Scheduling.kt
@@ -24,6 +24,7 @@ import com.cronutils.model.time.ExecutionTime
import com.cronutils.parser.CronParser
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.ktor.client.HttpClient
+import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.time.delay
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
index a3b17c4..3c20fbf 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -168,10 +168,7 @@ val client = HttpClient {
expectSuccess = false // this way, it does not throw exceptions on != 200
responses.
}
-fun serverMain(dbName: String, host: String, port: Int) {
- execThrowableOrTerminate {
- dbCreateTables(dbName)
- }
+fun serverMain(host: String, port: Int) {
val server = embeddedServer(Netty, port = port, host = host) {
install(CallLogging) {
this.level = Level.DEBUG
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: make sure task scheduler is executed,
gnunet <=