fix: parse cronID correctly
This commit is contained in:
1 file changed
+3
-8
@@ -159,12 +159,8 @@ func CommandSet(appName string, property string, value string) error {
|
|||||||
return fmt.Errorf("Task maintenance properties cannot be set globally")
|
return fmt.Errorf("Task maintenance properties cannot be set globally")
|
||||||
}
|
}
|
||||||
|
|
||||||
maintenanceParts := strings.SplitN(property, ".", 2)
|
cronTaskID := strings.TrimPrefix(property, MaintenancePropertyPrefix)
|
||||||
if len(maintenanceParts) != 3 {
|
if cronTaskID == "" {
|
||||||
return fmt.Errorf("Invalid task maintenance property, expected format: %s$ID: %s", MaintenancePropertyPrefix, property)
|
|
||||||
}
|
|
||||||
|
|
||||||
if maintenanceParts[1] == "" {
|
|
||||||
return fmt.Errorf("Invalid task maintenance property, missing ID")
|
return fmt.Errorf("Invalid task maintenance property, missing ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,9 +169,8 @@ func CommandSet(appName string, property string, value string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
maintenanceID := maintenanceParts[1]
|
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
if task.ID == maintenanceID {
|
if task.ID == cronTaskID {
|
||||||
validProperties[property] = ""
|
validProperties[property] = ""
|
||||||
globalProperties[property] = false
|
globalProperties[property] = false
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in new issue
Block a user