Skip to content

Commit

Permalink
fix(#24): ensure the cache directory exists before attempting to stor…
Browse files Browse the repository at this point in the history
…e signals
  • Loading branch information
kkostov committed Jul 10, 2024
1 parent 06e27d5 commit 2a30464
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class PersistentSignalCache(private var signalQueue: MutableList<Signal> = mutab
}

private fun saveSignals() {
// make sure the parent folder exists before writing
file?.parentFile?.mkdirs()
file?.createNewFile()
val json = Json.encodeToString(signalQueue)
file?.writeText(json)
Expand Down

0 comments on commit 2a30464

Please sign in to comment.