forked from External/ergo
switch to redis pubsub for ipc
adjust commands to utilize channel names add new config variables fix mention race condition
This commit is contained in:
parent
64ebb1f480
commit
f4c03b6765
12 changed files with 220 additions and 195 deletions
|
|
@ -36,6 +36,8 @@ import (
|
|||
"github.com/ergochat/ergo/irc/mysql"
|
||||
"github.com/ergochat/ergo/irc/sno"
|
||||
"github.com/ergochat/ergo/irc/utils"
|
||||
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -98,7 +100,7 @@ type Server struct {
|
|||
defcon atomic.Uint32
|
||||
|
||||
// CEF
|
||||
cefManager *CefConnection
|
||||
redis *redis.Client
|
||||
}
|
||||
|
||||
// NewServer returns a new Oragono server.
|
||||
|
|
@ -166,7 +168,12 @@ func (server *Server) Shutdown() {
|
|||
func (server *Server) Run() {
|
||||
defer server.Shutdown()
|
||||
|
||||
server.cefManager = cefConnection(server)
|
||||
redisOpts, err := redis.ParseURL(server.Config().Cef.Redis)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
server.redis = redis.NewClient(redisOpts)
|
||||
startRedis(server)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue