Skip to content

Commit

Permalink
Who uses this?
Browse files Browse the repository at this point in the history
  • Loading branch information
demidko committed Jan 3, 2025
1 parent 479aa20 commit 2af6fc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ open class ApplicationFactory {

init {
val duration = config.restrictionsDuration.toKotlinDuration()
println("Using duration $duration")
println("I - using duration $duration")
}

open val restrictions = ChatPermissions(
Expand Down
5 changes: 2 additions & 3 deletions src/main/kotlin/com/github/demidko/glock/GlockApplication.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.demidko.glock

import java.lang.Thread.sleep
import java.lang.Thread.startVirtualThread
import java.lang.Thread.*
import java.time.Duration
import java.time.Duration.ofSeconds

Expand All @@ -13,7 +12,7 @@ fun main(args: Array<String>) {

private fun startLoopWithFixedRate(every: Duration, action: () -> Unit) {
startVirtualThread {
while (!Thread.interrupted()) {
while (interrupted().not()) {
sleep(every)
action()
}
Expand Down

0 comments on commit 2af6fc8

Please sign in to comment.