mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-12 09:00:54 +00:00
Fix race condition during testing
This commit is contained in:
parent
9f5eb5818a
commit
6f612f881e
1 changed files with 11 additions and 7 deletions
|
@ -59,6 +59,8 @@ var ResponseSuccess = ClientMessage{Command: SuccessCommand}
|
|||
// Configuration is the active ConfigFile.
|
||||
var Configuration *ConfigFile
|
||||
|
||||
var janitorsOnce sync.Once
|
||||
|
||||
// SetupServerAndHandle starts all background goroutines and registers HTTP listeners on the given ServeMux.
|
||||
// Essentially, this function completely preps the server for a http.ListenAndServe call.
|
||||
// (Uses http.DefaultServeMux if `serveMux` is nil.)
|
||||
|
@ -106,14 +108,16 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
|
|||
logstasher.Setup(Configuration.ESServer, Configuration.ESIndexPrefix, Configuration.ESHostName)
|
||||
}
|
||||
|
||||
go authorizationJanitor()
|
||||
go bunchCacheJanitor()
|
||||
go pubsubJanitor()
|
||||
go aggregateDataSender()
|
||||
go commandCounter()
|
||||
janitorsOnce.Do(func() {
|
||||
go authorizationJanitor()
|
||||
go bunchCacheJanitor()
|
||||
go pubsubJanitor()
|
||||
go aggregateDataSender()
|
||||
go commandCounter()
|
||||
|
||||
go ircConnection()
|
||||
go shutdownHandler()
|
||||
go ircConnection()
|
||||
go shutdownHandler()
|
||||
})
|
||||
}
|
||||
|
||||
func shutdownHandler() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue