Skip to content

Commit ff13cbc

Browse files
committed
Fix concurrency issue
1 parent dd63f11 commit ff13cbc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/kotlin/org/polyfrost/polytime/client/realtime/RealTimeHandler.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ object RealTimeHandler {
2525

2626
val currentTime: Float
2727
get() {
28+
if (currentlyUpdating) {
29+
return 0f
30+
}
31+
2832
if (!::data.isInitialized) {
2933
populate() // Hopefully this blocks the thread until the data is initialized
3034
}

0 commit comments

Comments
 (0)