mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 19:22:41 +01:00
Merge pull request #1797 from slingamn/signals
move signals code to utils/
This commit is contained in:
commit
20d8d269ca
@ -99,7 +99,7 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) {
|
|||||||
listeners: make(map[string]IRCListener),
|
listeners: make(map[string]IRCListener),
|
||||||
logger: logger,
|
logger: logger,
|
||||||
rehashSignal: make(chan os.Signal, 1),
|
rehashSignal: make(chan os.Signal, 1),
|
||||||
exitSignals: make(chan os.Signal, len(ServerExitSignals)),
|
exitSignals: make(chan os.Signal, len(utils.ServerExitSignals)),
|
||||||
defcon: 5,
|
defcon: 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Attempt to clean up when receiving these signals.
|
// Attempt to clean up when receiving these signals.
|
||||||
signal.Notify(server.exitSignals, ServerExitSignals...)
|
signal.Notify(server.exitSignals, utils.ServerExitSignals...)
|
||||||
signal.Notify(server.rehashSignal, syscall.SIGHUP)
|
signal.Notify(server.rehashSignal, syscall.SIGHUP)
|
||||||
|
|
||||||
time.AfterFunc(alwaysOnExpirationPollPeriod, server.handleAlwaysOnExpirations)
|
time.AfterFunc(alwaysOnExpirationPollPeriod, server.handleAlwaysOnExpirations)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
// Copyright (c) 2020 Shivaram Lingamneni
|
// Copyright (c) 2020 Shivaram Lingamneni
|
||||||
// released under the MIT license
|
// released under the MIT license
|
||||||
|
|
||||||
package irc
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
@ -4,7 +4,7 @@
|
|||||||
// Copyright (c) 2020 Shivaram Lingamneni
|
// Copyright (c) 2020 Shivaram Lingamneni
|
||||||
// released under the MIT license
|
// released under the MIT license
|
||||||
|
|
||||||
package irc
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
Loading…
Reference in New Issue
Block a user