From 32c32bb24e3e8c17e17aab8f67e2e6e2a02f191a Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 30 Nov 2019 21:46:54 -0800 Subject: [PATCH] Fix improper goroutine --- server/config_parser.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/config_parser.go b/server/config_parser.go index 17acc77..790c600 100644 --- a/server/config_parser.go +++ b/server/config_parser.go @@ -1,6 +1,7 @@ package server import ( + "github.com/pterodactyl/wings/parser" "go.uber.org/zap" "sync" ) @@ -13,20 +14,20 @@ func (s *Server) UpdateConfigurationFiles() { for _, v := range s.processConfiguration.ConfigurationFiles { wg.Add(1) - go func(server *Server) { + go func(f parser.ConfigurationFile, server *Server) { defer wg.Done() - p, err := s.Filesystem.SafePath(v.FileName) + p, err := s.Filesystem.SafePath(f.FileName) if err != nil { zap.S().Errorw("failed to generate safe path for configuration file", zap.String("server", server.Uuid), zap.Error(err)) 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)) } - }(s) + }(v, s) } wg.Wait()