Skip to content

Commit

Permalink
Use daemon threads for FileWatcher #387
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Aug 6, 2023
1 parent de97dc3 commit 02e2e17
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -27,7 +27,7 @@ class FileWatcher(private val dir: String) : Watchable {
StandardWatchEventKinds.ENTRY_DELETE
)

Executors.newSingleThreadExecutor().submit {
Executors.newSingleThreadExecutor { Thread(it).apply { isDaemon = true } }.submit {
while (true) {
try {
val watchKey = watchService.take()
Expand Down

0 comments on commit 02e2e17

Please sign in to comment.