Browse Source

Optimize func

Vova Tkach 5 years ago
parent
commit
3da6d28461
1 changed files with 5 additions and 2 deletions
  1. 5 2
      engine/wrapper/wrapper.go

+ 5 - 2
engine/wrapper/wrapper.go

@@ -275,8 +275,11 @@ func (this *Wrapper) ConfigSave() error {
 }
 
 func (this *Wrapper) RecreateProductXmlFile() error {
-	if _, err := os.Create(this.DTmp + string(os.PathSeparator) + "trigger.xml.run"); err != nil {
-		return err
+	trigger := strings.Join([]string{this.DTmp, "trigger.xml.run"}, string(os.PathSeparator))
+	if !utils.IsFileExists(trigger) {
+		if _, err := os.Create(trigger); err != nil {
+			return err
+		}
 	}
 	return nil
 }