Skip to content

Commit

Permalink
bugfix(ClustConfig): prevent local network clustering by appending ma…
Browse files Browse the repository at this point in the history
…chine user name
  • Loading branch information
jacob-xhio committed Apr 9, 2024
1 parent 9798dec commit 0220b05
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions grails-app/init/io/xh/hoist/ClusterConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ import com.hazelcast.collection.ISet
import com.hazelcast.config.MaxSizePolicy
import com.hazelcast.config.NearCacheConfig
import grails.core.GrailsClass
import io.xh.hoist.cache.Entry
import io.xh.hoist.cluster.ClusterResponse
import io.xh.hoist.cluster.ReplicatedValueEntry
import io.xh.hoist.kryo.KryoSupport

import static io.xh.hoist.util.InstanceConfigUtils.appEnvironment
Expand All @@ -28,6 +25,7 @@ import static grails.util.Holders.grailsApplication
import static io.xh.hoist.util.Utils.appBuild
import static io.xh.hoist.util.Utils.appCode
import static io.xh.hoist.util.Utils.appVersion
import static io.xh.hoist.util.Utils.isLocalDevelopment
import static java.util.UUID.randomUUID

class ClusterConfig {
Expand Down Expand Up @@ -70,8 +68,9 @@ class ClusterConfig {
*/
protected String generateClusterName() {
List ret = [appCode, appEnvironment, appVersion]
if (appVersion.contains('SNAPSHOT')) ret << appBuild
if (appVersion.contains('SNAPSHOT') && appBuild != 'UNKNOWN') ret << appBuild
if (!multiInstanceEnabled) ret << randomUUID().toString().take(8)
if (isLocalDevelopment) ret << System.getProperty('user.name')
return ret.join('-')
}

Expand Down

0 comments on commit 0220b05

Please sign in to comment.