...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package redisserver
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -20,7 +21,7 @@ type Server struct {
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
TCPPort string
|
||||
TCPPort int
|
||||
UnixSocketPath string
|
||||
}
|
||||
|
||||
@@ -38,8 +39,8 @@ func NewServer(config ServerConfig) *Server {
|
||||
go s.cleanupExpiredKeys()
|
||||
|
||||
// Start TCP server if port is provided
|
||||
if config.TCPPort != "" {
|
||||
tcpAddr := ":" + config.TCPPort
|
||||
if config.TCPPort != 0 {
|
||||
tcpAddr := ":" + strconv.Itoa(config.TCPPort)
|
||||
go s.startRedisServer(tcpAddr, "")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user