Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 39c6f6d

Browse files
committed
refactor(sync-registry): synchronize lastChangeIds for thread safety
1 parent e8bc3e9 commit 39c6f6d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

surf-cloud-standalone/src/main/kotlin/dev/slne/surf/cloud/standalone/sync/SyncRegistryImpl.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ import dev.slne.surf.cloud.core.common.util.bean
1313
import dev.slne.surf.cloud.standalone.netty.server.NettyServerImpl
1414
import dev.slne.surf.surfapi.core.api.util.logger
1515
import dev.slne.surf.surfapi.core.api.util.mutableObject2LongMapOf
16+
import dev.slne.surf.surfapi.core.api.util.synchronize
1617

1718
@AutoService(SyncRegistry::class)
1819
class SyncRegistryImpl : CommonSyncRegistryImpl() {
1920
private val log = logger()
20-
private val lastChangeIds = mutableObject2LongMapOf<String>()
21+
private val lastChangeIds = mutableObject2LongMapOf<String>().synchronize()
2122

2223
override fun afterChange(syncValue: BasicSyncValue<*>) {
2324
super.afterChange(syncValue)

0 commit comments

Comments
 (0)