From eac38afe45cfcb2175819aabc3fb3257775661ce Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Thu, 28 Jan 2021 15:59:30 +0100 Subject: [PATCH] Fix some shit --- docker-compose.yml | 3 ++- src/main/kotlin/de/nycode/bankobot/Launcher.kt | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c527225..808ebf3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,8 @@ services: - "/etc/timezone:/etc/timezone:ro" - "/etc/localtime:/etc/localtime:ro" - ./logs:/user/app/logs + - ./.env:/usr/app/.env env_file: - .env ports: - - 127.0.0.1:8085:80 + - 127.0.0.1:8045:80 \ No newline at end of file diff --git a/src/main/kotlin/de/nycode/bankobot/Launcher.kt b/src/main/kotlin/de/nycode/bankobot/Launcher.kt index 86ecba1..b65dec5 100644 --- a/src/main/kotlin/de/nycode/bankobot/Launcher.kt +++ b/src/main/kotlin/de/nycode/bankobot/Launcher.kt @@ -29,11 +29,12 @@ import ch.qos.logback.classic.Logger import de.nycode.bankobot.config.Config import de.nycode.bankobot.config.Environment import io.sentry.Sentry +import io.sentry.SentryOptions import org.slf4j.LoggerFactory suspend fun main() { - initializeLogging() initializeSentry() + initializeLogging() BankoBot() } @@ -43,9 +44,12 @@ private fun initializeLogging() { } private fun initializeSentry() { - if (Config.ENVIRONMENT != Environment.DEVELOPMENT) { - Sentry.init { it.dsn = Config.SENTRY_TOKEN } - } else { - Sentry.init { it.dsn = "" } - } + val configure: (SentryOptions) -> Unit = + if (Config.ENVIRONMENT != Environment.DEVELOPMENT) { + { it.dsn = Config.SENTRY_TOKEN; } + } else { + { it.dsn = "" } + } + + Sentry.init(configure) }