Skip to content

Commit f0b8ccb

Browse files
committed
add tests
1 parent 0abd22b commit f0b8ccb

File tree

2 files changed

+406
-0
lines changed

2 files changed

+406
-0
lines changed

hitless/redis_connection_processor.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ func (rcp *RedisConnectionProcessor) SetPool(pooler pool.Pooler) {
111111
rcp.pool = pooler
112112
}
113113

114+
// GetCurrentWorkers returns the current number of workers (for testing)
115+
func (rcp *RedisConnectionProcessor) GetCurrentWorkers() int {
116+
rcp.scalingMu.Lock()
117+
defer rcp.scalingMu.Unlock()
118+
return rcp.currentWorkers
119+
}
120+
121+
// GetScaleLevel returns the current scale level (for testing)
122+
func (rcp *RedisConnectionProcessor) GetScaleLevel() int {
123+
rcp.scalingMu.Lock()
124+
defer rcp.scalingMu.Unlock()
125+
return rcp.scaleLevel
126+
}
127+
114128
// IsHandoffPending returns true if the given connection has a pending handoff
115129
func (rcp *RedisConnectionProcessor) IsHandoffPending(conn *pool.Conn) bool {
116130
_, pending := rcp.pending.Load(conn)

0 commit comments

Comments
 (0)