1
0
Fork 0
forked from External/ergo

genericize atomic config changes

This commit is contained in:
Shivaram Lingamneni 2022-05-03 11:06:57 -04:00
parent 66bf6244f3
commit c603d41d08
3 changed files with 35 additions and 9 deletions

View file

@ -17,7 +17,6 @@ import (
"sync"
"syscall"
"time"
"unsafe"
"github.com/ergochat/irc-go/ircfmt"
"github.com/okzk/sdnotify"
@ -66,7 +65,7 @@ type Server struct {
channels ChannelManager
channelRegistry ChannelRegistry
clients ClientManager
config unsafe.Pointer
config utils.ConfigStore[Config]
configFilename string
connectionLimiter connection_limits.Limiter
ctime time.Time
@ -704,7 +703,7 @@ func (server *Server) applyConfig(config *Config) (err error) {
config.Server.Cloaks.SetSecret(LoadCloakSecret(server.store))
// activate the new config
server.SetConfig(config)
server.config.Set(config)
// load [dk]-lines, registered users and channels, etc.
if initial {