chore(portforward): remove double log when clearing port forward file
This commit is contained in:
@@ -14,7 +14,11 @@ func (s *Service) writePortForwardedFile(ports []uint16) (err error) {
|
||||
fileData := []byte(strings.Join(portStrings, "\n"))
|
||||
|
||||
filepath := s.settings.Filepath
|
||||
if len(ports) == 0 {
|
||||
s.logger.Info("clearing port file " + filepath)
|
||||
} else {
|
||||
s.logger.Info("writing port file " + filepath)
|
||||
}
|
||||
const perms = os.FileMode(0o644)
|
||||
err = os.WriteFile(filepath, fileData, perms)
|
||||
if err != nil {
|
||||
|
||||
@@ -59,8 +59,6 @@ func (s *Service) cleanup() (err error) {
|
||||
|
||||
s.ports = nil
|
||||
|
||||
filepath := s.settings.Filepath
|
||||
s.logger.Info("clearing port file " + filepath)
|
||||
err = s.writePortForwardedFile(nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("clearing port file: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user