feat: add ability to set maintenance mode for all cron tasks running for an app

Closes #6953
This commit is contained in:
Jose Diaz-Gonzalez committed 2025-06-08 22:34:47 -04:00
1 parent cc395b54dd
commit c0eb12f572
6 files changed
+70 -28

No files matched your search

+10 -4
View File
@@ -12,14 +12,16 @@ import (
var (
// DefaultProperties is a map of all valid cron properties with corresponding default property values
DefaultProperties = map[string]string{
"mailfrom": "",
"mailto": "",
"mailfrom": "",
"mailto": "",
"maintenance": "false",
}
// GlobalProperties is a map of all valid global cron properties
GlobalProperties = map[string]bool{
"mailfrom": true,
"mailto": true,
"mailfrom": true,
"mailto": true,
"maintenance": true,
}
)
@@ -59,6 +61,10 @@ func (t TemplateCommand) CronCommand() string {
// FetchCronEntries returns a list of cron commands for a given app
func FetchCronEntries(appName string) ([]TemplateCommand, error) {
commands := []TemplateCommand{}
if reportComputedMaintenance(appName) == "true" {
return commands, nil
}
appJSON, err := appjson.GetAppJSON(appName)
if err != nil {
return commands, fmt.Errorf("Unable to fetch app.json for app %s: %s", appName, err.Error())