Fix improper goroutine
This commit is contained in:
parent
1003abaa63
commit
32c32bb24e
|
@ -1,6 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/pterodactyl/wings/parser"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
@ -13,20 +14,20 @@ func (s *Server) UpdateConfigurationFiles() {
|
||||||
for _, v := range s.processConfiguration.ConfigurationFiles {
|
for _, v := range s.processConfiguration.ConfigurationFiles {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
|
||||||
go func(server *Server) {
|
go func(f parser.ConfigurationFile, server *Server) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
p, err := s.Filesystem.SafePath(v.FileName)
|
p, err := s.Filesystem.SafePath(f.FileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
zap.S().Errorw("failed to generate safe path for configuration file", zap.String("server", server.Uuid), zap.Error(err))
|
zap.S().Errorw("failed to generate safe path for configuration file", zap.String("server", server.Uuid), zap.Error(err))
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := v.Parse(p); err != nil {
|
if err := f.Parse(p); err != nil {
|
||||||
zap.S().Errorw("failed to parse and update server configuration file", zap.String("server", server.Uuid), zap.Error(err))
|
zap.S().Errorw("failed to parse and update server configuration file", zap.String("server", server.Uuid), zap.Error(err))
|
||||||
}
|
}
|
||||||
}(s)
|
}(v, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user