Skip to content

Commit c2ce10f

Browse files
committed
delaying working dir creation to when its needed, lazy is sychronised by default
1 parent 8d668cc commit c2ce10f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/RoomSyncEphemeralTemporaryStore.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ internal class RoomSyncEphemeralTemporaryStoreFile @Inject constructor(
3939
moshi: Moshi
4040
) : RoomSyncEphemeralTemporaryStore {
4141

42-
private val workingDir = File(fileDirectory, "rr")
43-
.also { it.mkdirs() }
42+
private val workingDir: File by lazy {
43+
File(fileDirectory, "rr").also { it.mkdirs() }
44+
}
4445

4546
private val roomSyncEphemeralAdapter = moshi.adapter(RoomSyncEphemeral::class.java)
4647

0 commit comments

Comments
 (0)