Skip to content

Commit

Permalink
Fix eval command (#16)
Browse files Browse the repository at this point in the history
- Reformat code
  • Loading branch information
DRSchlaubi authored Jan 28, 2021
1 parent 5326a96 commit 844af8f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ services:
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
- ./logs:/user/app/logs
- ./.env:/usr/app/.env
env_file:
.env_file:
- .env
ports:
- 127.0.0.1:8045:80
3 changes: 1 addition & 2 deletions src/main/kotlin/de/nycode/bankobot/BankoBot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ object BankoBot : CoroutineScope {
.uuidRepresentation(UuidRepresentation.STANDARD)
.applyConnectionString(ConnectionString(Config.MONGO_URL))
.build()
)
.coroutine
).coroutine
database = client.getDatabase(Config.MONGO_DATABASE)

repositories.blacklist = database.getCollection("blacklist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ import kotlin.time.ExperimentalTime
import kotlin.time.TimeMark
import kotlin.time.TimeSource

// Because we cannot opt in to kotlin experimental time
// we need this wrapper
/**
* Wrapper class to measure time in scripts
*/
@OptIn(ExperimentalTime::class)
private class TimeMarker(private val start: TimeMark) {
class TimeMarker(private val start: TimeMark) {
private var end: Duration? = null

@Suppress("unused") // Called in scripts
Expand Down Expand Up @@ -92,6 +93,7 @@ fun evalCommand() = command("ev") {
import de.nycode.bankobot.*
import de.nycode.bankobot.utils.*
import de.nycode.bankobot.command.*
import de.nycode.bankobot.commands.dev.TimeMarker
import kotlinx.coroutines.runBlocking
timeMarker.markCompileEnd()
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/de/nycode/bankobot/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ import io.ktor.http.*
object Config {

val ENVIRONMENT: Environment by getEnv(default = Environment.PRODUCTION) {
Environment.valueOf(
it
)
Environment.valueOf(it)
}
val LOG_LEVEL: Level by getEnv(default = Level.INFO) { Level.toLevel(it) }

Expand Down

0 comments on commit 844af8f

Please sign in to comment.