aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-26 21:13:04 +0000
committerGitHub <noreply@github.com>2022-03-26 21:13:04 +0000
commitacb9fc5f8ee4818a99025978c08a57aa82faa1ad (patch)
treef2b252c4e37e6cf8fc92f1c9fecec2fd4fabb6a5 /services
parent70628bd870f54bef2c54c6c67c4f7e5e0481980b (diff)
downloadgitea-acb9fc5f8ee4818a99025978c08a57aa82faa1ad.tar.gz
gitea-acb9fc5f8ee4818a99025978c08a57aa82faa1ad.zip
Make cron task no notice on success (#19221)
Change all cron tasks to make them no notice on success default. Instead if a user wants notices on success they need to add NOTICE_ON_SUCCESS=true instead. ## :warning: BREAKING :warning: This changes the cron config so that notices on success are no longer set by default and breaks NO_SUCCESS_NOTICE settings. Instead users who want notices on success must set NOTICE_ON_SUCCESS=true instead. Signed-off-by: Andrew Thornton <art27@cantab.net> * Update custom/conf/app.example.ini Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: Norwin <noerw@users.noreply.github.com>
Diffstat (limited to 'services')
-rw-r--r--services/cron/setting.go4
-rw-r--r--services/cron/tasks_basic.go7
2 files changed, 5 insertions, 6 deletions
diff --git a/services/cron/setting.go b/services/cron/setting.go
index 3d9495764d..4ccb7c7ce3 100644
--- a/services/cron/setting.go
+++ b/services/cron/setting.go
@@ -26,7 +26,7 @@ type BaseConfig struct {
Enabled bool
RunAtStart bool
Schedule string
- NoSuccessNotice bool
+ NoticeOnSuccess bool
}
// OlderThanConfig represents a cron task with OlderThan setting
@@ -66,7 +66,7 @@ func (b *BaseConfig) DoRunAtStart() bool {
// DoNoticeOnSuccess returns whether a success notice should be posted
func (b *BaseConfig) DoNoticeOnSuccess() bool {
- return !b.NoSuccessNotice
+ return b.NoticeOnSuccess
}
// FormatMessage returns a message for the task
diff --git a/services/cron/tasks_basic.go b/services/cron/tasks_basic.go
index fdf8550c31..f5bbbaa0b4 100644
--- a/services/cron/tasks_basic.go
+++ b/services/cron/tasks_basic.go
@@ -28,10 +28,9 @@ func registerUpdateMirrorTask() {
RegisterTaskFatal("update_mirrors", &UpdateMirrorTaskConfig{
BaseConfig: BaseConfig{
- Enabled: true,
- RunAtStart: false,
- Schedule: "@every 10m",
- NoSuccessNotice: true,
+ Enabled: true,
+ RunAtStart: false,
+ Schedule: "@every 10m",
},
PullLimit: 50,
PushLimit: 50,