Merge pull request #1949 from slingamn/generic_config.2

genericize atomic config changes
This commit is contained in:
Shivaram Lingamneni 2022-05-04 01:30:52 -04:00 committed by GitHub
commit d5814c10ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 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
@ -706,7 +705,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 {