gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 02/02: Delaying scheduled tasks detection.


From: gnunet
Subject: [libeufin] 02/02: Delaying scheduled tasks detection.
Date: Thu, 25 Mar 2021 10:25:04 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit b4b71a4064b6b2e220b5d2cd333ebf9475fcd85d
Author: ms <ms@taler.net>
AuthorDate: Thu Mar 25 10:21:56 2021 +0100

    Delaying scheduled tasks detection.
    
    That used to happen before the responsible database
    tables got completely created, resulting in many database
    errors due to a non existent table.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt             |  3 +++
 .../src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 11 +++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index 81ed787..4927b10 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -34,7 +34,9 @@ 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.*
 import java.io.File
 
@@ -60,6 +62,7 @@ class Serve : CliktCommand("Run nexus HTTP server") {
     override fun run() {
         setLogLevel(logLevel)
         serverMain(getDbConnFromEnv(NEXUS_DB_ENV_VAR_NAME), host, port)
+        startOperationScheduler(client)
     }
 }
 
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 90c6f81..737912d 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt
@@ -183,13 +183,14 @@ fun requireBankConnection(call: ApplicationCall, 
parameterKey: String): NexusBan
     return requireBankConnectionInternal(name)
 }
 
+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)
     }
-    val client = HttpClient {
-        expectSuccess = false // this way, it does not throw exceptions on != 
200 responses.
-    }
     val server = embeddedServer(Netty, port = port, host = host) {
         install(CallLogging) {
             this.level = Level.DEBUG
@@ -251,8 +252,6 @@ fun serverMain(dbName: String, host: String, port: Int) {
                 return@intercept finish()
             }
         }
-
-        startOperationScheduler(client)
         routing {
             get("/config") {
                 call.respond(
@@ -1065,4 +1064,4 @@ fun serverMain(dbName: String, host: String, port: Int) {
         logger.error(e.message)
         exitProcess(1)
     }
-}
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]