refactor(billing+entries): remove unused import and adjust tenant transaction signature
This commit is contained in:
-1
@@ -9,7 +9,6 @@ import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
|||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import org.springframework.beans.factory.annotation.Value
|
import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
import org.springframework.context.annotation.Profile
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
class BillingDatabaseConfiguration(
|
class BillingDatabaseConfiguration(
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import org.jetbrains.exposed.v1.jdbc.transactions.transaction
|
|||||||
/**
|
/**
|
||||||
* Führt einen Exposed-Transaction-Block im Kontext des aktuellen Tenants aus und setzt das Suchpfad-Schema.
|
* Führt einen Exposed-Transaction-Block im Kontext des aktuellen Tenants aus und setzt das Suchpfad-Schema.
|
||||||
*/
|
*/
|
||||||
suspend inline fun <T> tenantTransaction(crossinline block: () -> T): T = transaction {
|
inline fun <T> tenantTransaction(crossinline block: () -> T): T = transaction {
|
||||||
val schema = TenantContextHolder.current()?.schemaName
|
val schema = TenantContextHolder.current()?.schemaName
|
||||||
?: error("No tenant in context. Ensure TenantWebFilter is installed and request has X-Event-Id")
|
?: error("No tenant in context. Ensure TenantWebFilter is installed and request has X-Event-Id")
|
||||||
// Set search_path for this transaction/connection
|
// Set search_path for this transaction/connection
|
||||||
|
|||||||
Reference in New Issue
Block a user