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 9b841a6 commit e0b9fcf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
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 e0b9fcf

Please sign in to comment.