fix: parse cronID correctly

This commit is contained in:
Jose Diaz-Gonzalez committed 2025-11-10 01:56:59 -05:00
1 parent 4929272c87
commit 3638399726
1 file changed
+3 -8
+3 -8
View File
@@ -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